Tagged: CPT, meta-box, thumbanils image
- This topic has 2 replies, 2 voices, and was last updated 6 years, 6 months ago by
bicho44.
Viewing 2 reply threads
-
AuthorPosts
-
-
July 24, 2015 at 11:49 am #4067
bicho44MemberHi again, i have a cpt defined, with the
hide metaboxset to hide the feature image box because iam using the piklist version, but i cant make it work, any pointer will be nice 😀function barcos_post_type($post_types) { $post_types['barcos'] = array( 'labels' => piklist('post_type_labels', 'Barco') ,'title' => __('Ingrese un nuevo Barco', 'imgd') ,'public' => true ,'capability_type' => 'page' ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'rewrite' => array( 'slug' => 'barco' ) ,'supports' => array( 'title', 'editor', 'author', 'thumbnail' //I need this to use it with helpers, 'page-attributes' ) ,'hide_meta_box' => array( 'slug' ,'author' ,'revisions' ,'comments' /* here the Feature images */ ,'thumbnail' ,'FeaturedImage' ,'Featured Image' /* end the Feature images */ ,'commentstatus' ) ); return $post_types; } -
July 24, 2015 at 2:37 pm #4068
SteveKeymaster@bicho44– This is definitely a bug. You’re going to need to do this old school:
function my_remove_postimagediv() { remove_meta_box('postimagediv', 'barcos', 'side'); } add_action('do_meta_boxes', 'my_remove_postimagediv');More info at the WordPress codex.
-
July 24, 2015 at 9:08 pm #4073
bicho44MemberHi Steve:
Thanks for the info. But…
FYI
If we call thehide_meta_boxto the divpostimagedivlike this,'hide_meta_box' => array( /* here the Feature image div */ ,'postimagediv' )Works OK and the metabox is hidden
So, the bug to resolve is maybe Piklist must have an ‘alias’ (?) to that div, maybe, ‘featureimage’ (i like that)
Also a note in the docs will be a nice addition 😀
Thanks in advance
Fede
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.