Pressidium specific WordPress actions and filters
Hooks in WordPress are a way for one piece of code to interact and/or modify another piece of code at specific, pre-defined spots. They are used extensively throughout third-party plugins, themes, and by Core itself.
Pressidium specific WordPress actions
The following actions are defined in our must-use plugin and can be used to implement theme or plugin specific workflows and additional logic when triggered.
| Action | Arguments | Description |
|---|---|---|
pressidium_site_purged | $blog_domains | Fires after the site was entirely purged from the cache. |
pressidium_network_site_purged | $blog_domains | Fires after all sites of the network were entirely purged from cache. |
pressidium_partial_cache_purged | $post_ids, $domains, $paths, $cache_tags | Fires after one or more posts were automatically purged from the cache (on posts insert/update/delete, comments update, etc.) This is not triggered when the cache is manually purged. |
pressidium_partial_cache_purged_manually | $domains, $paths, $cache_tags | Fires after one or more posts were manually purged. |
pressidium_page_purged | $posts, $domains, $paths | (Deprecated) Use pressidium_partial_cache_purged instead.Fires after one or more pages were automatically purged from cache from our must-use plugin (on posts insert/update/delete, comments update, etc.). It is not triggered when a manual cache purge is requested via NinukisCaching::purge_cache(). |
pressidium_page_paths_purged | $domains, $paths | (Deprecated) Use pressidium_partial_cache_purged_manually instead.Fires after one or more pages were purged from cache by manually invoking the NinukisCaching::purge_cache() method. |
pressidium_site_purged
Fires after the site was entirely purged from cache.
do_action( 'pressidium_site_purged', array $blog_domains )
Parameters
$blog_domains
(array) Mapped domains to purge from cache.
pressidium_network_site_purged
Fires after all sites of the network were entirely purged from cache.
do_action( 'pressidium_network_site_purged', array $blog_domains )
Parameters
$blog_domains
(array) Mapped domains to purge from cache.
pressidium_partial_cache_purged
Fires after one or more posts were automatically purged from the cache (on posts insert/update/delete, comments update, etc.) This is not triggered when the cache is manually purged.
do_action( 'pressidium_partial_cache_purged', array $post_ids, array $domains, array $paths, array $cache_tags )
Parameters
$posts
(array) IDs of the posts (or pages) to purge from the cache.
$domains
(array) Mapped domains to purge from the cache.
$paths
(array) Paths to purge from the cache.
$cache_tags
(array) Cache tags to purge from the cache.
pressidium_partial_cache_purged_manually
Fires after one or more posts were manually purged from the cache.
do_action( 'pressidium_partial_cache_purged_manually', array $domains, array $paths, array $cache_tags )
Parameters
$domains
(array) Domains purged.
$paths
(array) Paths purged.
$cache_tags
(array) Cache tags purged.
Pressidium specific WordPress filters
The following hooks are defined in our must-use plugin and can be used to modify the default behavior.
| Filter | Arguments | Description |
pressidium_cache_tags | $cache_tags | Filters the list of cache tags to add to the response. |
pressidium_purge_paths | <code>$paths, $post_ids | Filters the computed paths that are going to be purged from the cache. |
pressidium_purge_cache_tags | $cache_tags, $post_ids | Filters the computed cache tags that are going to be purged from the cache. |
pressidium_multisite_mapped_domains | $mapped_domains, $blog_id | Filters the list of mapped domains a blog may be associated with. |
pressidium_purge_page_cache | $paths, $posts | (Deprecated) Use pressidium_purge_paths instead.Filters the computed paths that are going to be purged from the cache. |
pressidium_cache_tags
Filters the list of cache tags to add to the response.
apply_filters( 'pressidium_cache_tags', array $cache_tags )
Parameters
$cache_tags
(array) The list of cache tags to add.
pressidium_purge_paths
Filters the computed paths that are going to be purged.
apply_filters( 'pressidium_purge_paths', array $paths, array $post_ids )
Parameters
$paths
(array) Paths to be purged.
$post_ids
(array) IDs of the posts (or pages) to be purged.
pressidium_purge_cache_tags
Filters the computed cache tags that are going to be purged.
apply_filters( 'pressidium_purge_cache_tags', array $cache_tags, array $post_ids )
Parameters
$cache_tags
(array) Cache tags to be purged.
$post_ids
(array) IDs of the posts (or pages) to be purged.
pressidium_multisite_mapped_domains
Filters the list of mapped domains a blog may be associated with.
apply_filters( 'pressidium_multisite_mapped_domains', array $mapped_domains, int|null $blog_id )
Parameters
$mapped_domains
(array) Mapped domains.
$blog_id
(int|null) ID of the blog.
Need help?
If you are not sure whether a Pressidium-specific action or filter is appropriate for your use case, contact our Support team before adding custom code.
Where to go next
- Create an instant backup before adding or changing custom code.
- Initialize your staging environment to test custom behavior before applying it to production.
- Review access, error or MySQL slow logs if custom code causes warnings, errors, or unexpected behavior.
- Manage SFTP users if developers need file access to add or review code.
Was this article helpful?