clean_site_cache
Action HookDescription
Fires immediately after a site has been removed from the object cache.Hook Information
File Location |
wp-includes/ms-site.php
View on GitHub
|
Hook Type | Action |
Line Number | 1007 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$id
|
Site ID as a numeric string. |
WP_Site
|
$blog
|
Site object. |
string
|
$domain_path_key
|
md5 hash of domain and path. |
Usage Examples
Basic Usage
<?php
// Hook into clean_site_cache
add_action('clean_site_cache', 'my_custom_function', 10, 3);
function my_custom_function($id, $blog, $domain_path_key) {
// Your custom code here
}
Source Code Context
wp-includes/ms-site.php:1007
- How this hook is used in WordPress core
<?php
1002 *
1003 * @param string $id Site ID as a numeric string.
1004 * @param WP_Site $blog Site object.
1005 * @param string $domain_path_key md5 hash of domain and path.
1006 */
1007 do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
1008
1009 wp_cache_set_sites_last_changed();
1010
1011 /**
1012 * Fires after the blog details cache is cleared.
PHP Documentation
<?php
/**
* Fires immediately after a site has been removed from the object cache.
*
* @since 4.6.0
*
* @param string $id Site ID as a numeric string.
* @param WP_Site $blog Site object.
* @param string $domain_path_key md5 hash of domain and path.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/ms-site.php
Related Hooks
Related hooks will be displayed here in future updates.