Invalidation of custom posts


#1

Guys!

I think that there is a bug regarding invalidation of custom posts.

While in the admin area there is an aggregated setting to “Purge Post/Page/Custom Post Type:” ( like http://screencast.com/t/Dnje1cZZJMYl) in the code (function start_helper() of nginx-helper.php) in order to decide whether to invalidate custom posts you have the following checks :

first:

    $args = array('_builtin' => false);
    $_rt_custom_post_types = get_post_types($args);
    if (isset($post_types) && !empty($post_types)) {

which does not work as you have to check $_rt_custom_post_types vs $post_types to be non-empty

then:

 $_rt_custom_post_types = get_post_types($args);
            if (isset($post_types) && !empty($post_types)) {
                if ($this->options['rt_wp_custom_post_types'] == true) {
                    foreach ($_rt_custom_post_types as $post_type) {
                        add_action('publish_' . trim($post_type), array(&$rt_wp_nginx_purger, 'purgePost'), 200, 1);
                    }
                }
            }

the condition with $this->options['rt_wp_custom_post_types'] will never be true, as this rt_wp_custom_post_types does not appear among options (should be probably purge_page_on_mod instead)

Hope this makes some sense.

Best, Eugene


#2