File Editor
Directories:
.. (Back)
Files:
class.wp-super-cache-rest-delete-cache.php
class.wp-super-cache-rest-get-cache.php
class.wp-super-cache-rest-get-plugins.php
class.wp-super-cache-rest-get-settings.php
class.wp-super-cache-rest-get-stats.php
class.wp-super-cache-rest-get-status.php
class.wp-super-cache-rest-preload.php
class.wp-super-cache-rest-test-cache.php
class.wp-super-cache-rest-update-plugins.php
class.wp-super-cache-rest-update-settings.php
class.wp-super-cache-settings-map.php
load.php
Create New File
Create
Edit File: class.wp-super-cache-rest-delete-cache.php
<?php class WP_Super_Cache_Rest_Delete_Cache extends WP_REST_Controller { /** * Get a collection of items * * @param WP_REST_Request $request Full data about the request. * @return WP_Error|WP_REST_Response */ public function callback( $request ) { $params = $request->get_json_params(); if ( isset( $params['id'] ) && is_numeric( $params['id'] ) ) { wpsc_delete_post_cache( $params['id'] ); } elseif ( !empty( $params['expired'] ) ) { global $file_prefix; wp_cache_clean_expired( $file_prefix ); } elseif ( isset( $params['url'] ) ) { global $cache_path; $directory = $cache_path . 'supercache/' . $params[ 'url' ]; wpsc_delete_files( $directory ); prune_super_cache( $directory . '/page', true ); } else { global $file_prefix; wp_cache_clean_cache( $file_prefix, !empty( $params['all'] ) ); } return rest_ensure_response( array( 'Cache Cleared' => true ) ); } }
Save Changes
Rename File
Rename