domain_mapping_gc_cache()
No Hooks.
Returns
null. Nothing (null).
Usage
domain_mapping_gc_cache( $function, $directory );
- $function(required)
- .
- $directory(required)
- .
domain_mapping_gc_cache() domain mapping gc cache code WPSCache 3.1.0
function domain_mapping_gc_cache( $function, $directory ) {
global $cache_path;
if ( ! function_exists( 'domain_mapping_warning' ) ) {
return;
}
$siteurl = domain_mapping_siteurl( false );
if ( ! $siteurl ) {
return;
}
$sitedir = trailingslashit( preg_replace( '`^(https?:)?//`', '', $siteurl ) );
if ( 'homepage' === $directory ) {
$directory = '';
}
switch ( $function ) {
case 'rebuild':
wpsc_rebuild_files( $cache_path . 'supercache/' . $sitedir . $directory );
break;
case 'prune':
wpsc_delete_files( $cache_path . 'supercache/' . $sitedir . $directory );
break;
}
}