• Resolved ttremain

    (@ttremain)


    I found this code that is supposed to clear the cache, either fully, or per postID (page)

    It doesn’t seem to be doing so for me.

    
    // initilize WordPress environment
    if (!defined('ABSPATH')) {
        require_once('./wp-load.php');
    }
    
    if (has_action('ce_clear_cache')) {
        do_action('ce_clear_cache');
    }
    
    if (has_action('ce_clear_post_cache')) {
        do_action('ce_clear_post_cache', 1111); // post_id
    }
    

    Found here

    I can confirm that the action does exist, via has_action()

Viewing 1 replies (of 1 total)
  • Anonymous User 16850768

    (@anonymized-16850768)

    To troubleshoot this further, can you please provide the actual snippet you’re attempting to use that is not working in addition to the location where it is being fired (e.g. functions.php file)?

Viewing 1 replies (of 1 total)

The topic ‘Clear cache programatically’ is closed to new replies.