• hi,

    i’m using this wonderful plugin for my site but i can’t completely remove the custom template metabox from other page than the one i want.

    I set the Id post to the one of my page (2) and the plugin shows correctly the custom fields in that page but leaves an empty metabox to the others.

    i’ve try also whith

    add_action('admin_menu','remove_metabox');
    
    function remove_metabox(){
         if (!is_page(2)):
         remove_meta_box( 'cftdiv' , 'page' , 'normal' );
         endif;
    }

    but the box is removed from all the pages.

    how can i afford this problem?

    thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would also like to know how to do this.

    For Munman’s benefit:

    I’m not sure if you can use is_page in the admin area like that.

    Anyway I’d use the $_GET parameters to check what page you’re on so:

    add_action('admin_menu','remove_metabox');
    
    function remove_metabox(){
         if ( $_GET['post'] != 2 ):
         remove_meta_box( 'cftdiv' , 'page' , 'normal' );
         endif;
    }

    That should do the trick.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Custom Field Template] disable metabox in other pages’ is closed to new replies.