plugins – Save_post not working for WordPress default theme

Question

I’m trying to flush cache when a page or post is updated with save_post. The code work on other theme when a post/page is updated the save_post fires up. However, when TwentyTwenty theme or any other WordPress default theme is selected the save_post does not fires up. Please see my code snippet below:

I’ve tested it with priority but that does not resolve the issue.

``` function clear_cache_on_save() {

       wp_cache_flush(); 
    
}

add_action( 'save_post', 'clear_cache_on_save'); ```

0
Dacl 3 weeks 2021-07-06T21:57:37-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse