Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Swift Performance 2
- add_action('swift_performance_after_clear_post_cache', function($post_id){
- clean_post_cache($post_id);
- });
- add_action('swift_performance_after_clear_all_cache', function(){
- wp_cache_delete( 'all_page_ids', 'posts' );
- });
- // Swift Performance AI
- add_action('swift3_invalidate_cache', 'swiftai_clean_post_cache');
- add_action('swift3_purge_cache', 'swiftai_clean_post_cache');
- function swiftai_clean_post_cache($url){
- if (!empty($url)){
- clean_post_cache(url_to_postid($post_id));
- }
- else {
- wp_cache_delete( 'all_page_ids', 'posts' );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement