wp_cache_confirm_delete()
returns true/false depending on location of $dir.
No Hooks.
Returns
null. Nothing (null).
Usage
wp_cache_confirm_delete( $dir );
- $dir(required)
- .
wp_cache_confirm_delete() wp cache confirm delete code WPSCache 3.1.1
function wp_cache_confirm_delete( $dir ) {
global $cache_path, $blog_cache_dir;
// don't allow cache_path, blog cache dir, blog meta dir, supercache.
$dir = wpsc_get_realpath( $dir );
if ( ! $dir ) {
wp_cache_debug( 'wp_cache_confirm_delete: directory does not exist' );
return false;
}
if ( ! wpsc_is_in_cache_directory( $dir ) ) {
return false;
}
$rp_cache_path = wpsc_get_realpath( $cache_path );
if ( ! $rp_cache_path ) {
wp_cache_debug( "wp_cache_confirm_delete: cache_path does not exist: $cache_path" );
return false;
}
if (
$dir == $rp_cache_path ||
$dir == wpsc_get_realpath( $blog_cache_dir ) ||
$dir == wpsc_get_realpath( $blog_cache_dir . 'meta/' ) ||
$dir == wpsc_get_realpath( $cache_path . 'supercache' )
) {
return false;
} else {
return true;
}
}