• Surendra.S

    (@surendras)


    Hi Bill,
    Thank You for excellent plugin. This is very useful.

    Just 1 doubt. How can I extend this to Pages & Custom Post Types ?

    For eg, if I have a Custom Post Type called ‘movie’, then adding below code will do ?

    ==

    add_filter( ‘limit_modified_date_post_types’, function( $post_types ) {
    $post_types[] = ‘page’, ‘movie’;
    return $post_types;
    });

    ==

    And, where should I add above code ? functions.php ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • akiai

    (@akiai)

    You’ll need to edit the filter if you want multiple post types

    
    add_filter( 'limit_modified_date_post_types', function( $post_types ) {
      $post_types[] = 'page';
      $post_types[] = 'movie';
      return $post_types;
    });
    

    Add to functions.php yes.

    Thread Starter Surendra.S

    (@surendras)

    @akiai ! Thank You so much Sir.

    For Custom Post Types, I figured that I need to use exact Post Type Slug

    Something like:

    $post_types[] = 'cpt_movie';

    Now it all seems to be working good.

    Thanks again for ur help !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Works on Custom Post Type ?’ is closed to new replies.