DietPress 3.7.4 has 1 actions and 29 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when DietPress fires an action
add_action( 'dietpress_cache_purged_post', function( $ID ) {
// Your code runs here.
}, 10, 1 );
// Change a value DietPress is about to use
add_filter( 'core_diet_third_party_widgets', function( $widgets ) {
// Change $widgets here.
return $widgets;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filter to register additional third-party dashboard widgets. */ apply_filters( 'core_diet_third_party_widgets', $widgets ); -
/** * Filter whether the current page is kept out of the cache. */ apply_filters( 'dietpress_cache_bypass', false ); -
/** * Filter the media types that keep a request out of the page cache. */ apply_filters( 'dietpress_cache_bypass_accept', array( 'text/markdown' ) ); -
/** * Filter the cookie name prefixes that keep a visitor out of the cache. */ apply_filters( 'dietpress_cache_bypass_cookies', $prefixes ); -
/** * Filter whether this request ignores the page cache altogether. */ apply_filters( 'dietpress_cache_bypass_request', false ); -
/** * Filter the URL patterns excluded from the page cache. */ apply_filters( 'dietpress_cache_exclude_urls', $patterns ); -
/** * Filter the query parameters that never make a request uncacheable. */ apply_filters( 'dietpress_cache_ignored_params', $params ); -
/** * Filter the URLs purged along with a post. */ apply_filters( 'dietpress_cache_post_urls', $urls, $post ); -
/** * Fires after a post's cached pages have been purged. */ do_action( 'dietpress_cache_purged_post', $post->ID ); -
/** * Filter the exclusion list for Google Fonts local hosting. */ apply_filters( 'dietpress_exclude_local_fonts', array() ); -
/** * Filters whether DietPress leaves this page's Cache-Control alone. */ apply_filters( 'dietpress_html_cache_control_skip', $personal ); -
/** * Filter the substrings used to detect the site logo image. */ apply_filters( 'dietpress_logo_class_patterns', array( 'site-logo', 'custom-logo' ) ); -
/** * Filter whether a plugin depends on the native WordPress sitemap. */ apply_filters( 'dietpress_native_sitemap_in_use', $detected ); -
/** * Filter whether the current page shows this module's content. */ apply_filters( "dietpress_selective_{$slug}_has_content", $has_content ); -
/** * Filter the script handles dequeued when this module finds no content. */ apply_filters( "dietpress_selective_{$slug}_scripts", $scripts ); -
/** * Filter the style handles dequeued when this module finds no content. */ apply_filters( "dietpress_selective_{$slug}_styles", $styles ); -
/** * Filter whether the block library styles are dequeued on this page. */ apply_filters( 'dietpress_selective_blocks_dequeue', $dequeue ); -
/** * Filter whether the Everest Forms module also removes Dashicons. */ apply_filters( 'dietpress_selective_everest_forms_dequeue_dashicons', true ); -
/** * Filter whether the current page renders content the content scan cannot * reach. */ apply_filters( 'dietpress_selective_page_hides_content', $hidden ); -
/** * Filter whether this page shows a Slider Revolution slider. */ apply_filters( 'dietpress_selective_revslider_has_content', $has_content ); -
/** * Filter whether the cart fragments script must be kept on non-WooCommerce * pages. */ apply_filters( 'dietpress_selective_wc_keep_cart_fragments', $keep_fragments ); -
/** * Filter the list of script handles excluded from the defer pass. */ apply_filters( 'dietpress_skip_defer_script_handles', $excluded_handles, $handle ); -
/** * Filter the URL patterns excluded from the defer pass. */ apply_filters( 'dietpress_skip_defer_script_patterns', $this->core_diet_get_default_defer_skip_patterns() ); -
/** * Filter handles that should be excluded from the CSS defer pass. */ apply_filters( 'dietpress_skip_defer_style_handles', array(), $handle ); -
apply_filters( 'dietpress_critical_css', $critical_css ); -
apply_filters( 'dietpress_critical_css_handles', $critical_handles ); -
apply_filters( 'dietpress_critical_fonts', array() ); -
apply_filters( 'dietpress_dns_prefetch_domains', $prefetch_domains ); -
apply_filters( 'dietpress_preconnect_hints', $preconnects ); -
apply_filters( 'dietpress_preserve_plugin_version', $is_plugin_asset, $src );
Generated from DietPress's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: