wp_supercache_cache_for_admins() WPSCache 1.0
No Hooks.
Return
Null. Nothing.
Usage
wp_supercache_cache_for_admins();
Code of wp_supercache_cache_for_admins() wp supercache cache for admins WPSCache 1.7.1
function wp_supercache_cache_for_admins() {
// Don't remove cookies for some requests.
if (
wpsc_is_backend() ||
$_SERVER['REQUEST_METHOD'] !== 'GET' ||
isset( $_GET['preview'], $_GET['customize_changeset_uuid'] ) || // WPCS: CSRF ok.
strpos( stripslashes( $_SERVER['REQUEST_URI'] ), '/wp-json/' ) !== false // WPCS: sanitization ok.
) {
return true;
}
if ( false === do_cacheaction( 'wp_supercache_remove_cookies', true ) ) {
return true;
}
$removed_cookies = array();
foreach ( wpsc_get_auth_cookies() as $cookie ) {
$cookies = is_array( $cookie ) ? $cookie : array( $cookie );
foreach ( $cookies as $cookie_key ) {
unset( $_COOKIE[ $cookie_key ] );
$removed_cookies[] = $cookie_key;
}
}
if ( ! empty( $removed_cookies ) ) {
wp_cache_debug( 'Removing auth from $_COOKIE to allow caching for logged in user ( ' . implode( ', ', $removed_cookies ) . ' )', 5 );
}
}