Created
August 25, 2015 12:27
-
-
Save damianwajer/ea5f4f17b6aaef9785ad to your computer and use it in GitHub Desktop.
[WordPress] [WP Super Cache] Manually clear the cache from the code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Clear the cache on specific page | |
| */ | |
| if ( function_exists( 'wp_cache_post_change' ) ) { | |
| $GLOBALS["super_cache_enabled"] = 1; | |
| wp_cache_post_change( $post_id ); | |
| } | |
| /** | |
| * Clear all cache | |
| */ | |
| if ( function_exists( 'wp_cache_post_change' ) ) { | |
| wp_cache_clear_cache(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment