Viewing 4 replies - 1 through 4 (of 4 total)
  • The plugin is coded so you can apply a filter to remove it from types you don’t want. The function goes something like this (this is untested):

    function remove_plt_from_custom_type( $post_types )
    {
    if ( in_array( ‘mycustomtype’, $post_types ) ) {
    $index = array_search ( ‘mycustomtype’, $post_types );
    unset $post_types[$index];
    }
    return $post_types;
    }
    add_filter( ‘page-links-to-post-types’, ‘remove_plt_from_custom_type’ );

    You’d replace ‘mycustomtype’ with the slug of the post type you want to remove the meta box from.

    Thread Starter Jon

    (@freshyjon)

    The code snippet you are trying to save produced a fatal error on line 5:
    
    syntax error, unexpected '$post_types' (T_VARIABLE), expecting '('

    Yes, it absolutely does. Sorry about that — fire drill happened in the middle of posting. I missed a set of parentheses. Here it is, tested and working:

    function remove_plt_from_custom_type( $post_types )
    {
    if ( in_array( ‘mycustomtype’, $post_types ) ) {
    $index = array_search ( ‘mycustomtype’, $post_types );
    unset( $post_types[$index] );
    }
    return $post_types;
    }
    add_filter( ‘page-links-to-post-types’, ‘remove_plt_from_custom_type’ );

    Thread Starter Jon

    (@freshyjon)

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Is there an option to remove from certain Custom Post Type?’ is closed to new replies.