WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Purge policy on custom post tye (5 posts)

  1. Wellton
    Member
    Posted 1 year ago #

    Hi, i have a custom post type on my site. If i for instance change a post in that CPT the older version of it still remains on the index page of CPT. Although on the single-CPT page it shows the updated version.

    This only happens when I use disk enhanced or disk basic and not in APC mode for pagecache. I want it to work on the disk mode since that seems to makes the site faster.

    Does it have something to do with the purge policy? cant find custom post type there.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. dannybatista
    Member
    Posted 1 year ago #

    Would like some help on this as well. I need w3 total cache to purge the page cache on updates/edits to custom post types and it's not happening.

  3. cerco
    Member
    Posted 1 year ago #

    Purge policy for custom post types would be nice.

  4. Robert.Vidrine
    Member
    Posted 1 year ago #

    I'm really still learning PHP and WP, but as I understand it (I'm basing this largely on a similar thread in a WP Super Cache forum) the main issue is getting the custom post types in order to include them in the policy established for Posts and Pages.

    I've done a little poking around, but can't find where to hook into the existing functions in W3TC to add to the list of post types it "watches", but couldn't get_post_types be used to gather the list of whatever CPTs had been registered, and then programmatically add these to the "watch list"?
    I found this in the codex for getting a list of publicly-available CPTs:

    <?php
    $args=array(
      'public'   => true,
      '_builtin' => false
    );
    $output = 'names'; // names or objects, note names is the default
    $operator = 'and'; // 'and' or 'or'
    $post_types=get_post_types($args,$output,$operator);
      foreach ($post_types  as $post_type ) {
        echo '<p>'. $post_type. '</p>';
      }
    ?>
  5. dking64
    Member
    Posted 1 year ago #

    Same here: index page for my custom post type is not updating.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic