php - Use post_type in admin_menu action callback with wordpress
906
How can I accesspost_type
in the callback function foradmin_menu
action?
add_action( 'admin_menu' , 'remove_post_thumb_meta_box' );
function remove_post_thumb_meta_box()
{
global $pagenow, $_wp_theme_features;
if ( in_array( $pagenow,array('post.php','post-new.php')))
{
unset( $_wp_theme_features['post-thumbnails']);
}
}
I need to hidefeatured image metabox
only for post_typelocation
.
Answer
Solution:
You can do something like this:-
Add following line into your
theme's functions.php
file:-This will only effect your
location
post type.Hope it will help you.
Answer
Solution:
You can use the
function to remove the meta box. You can go and have a look at the parameters in the link I've provided
To better safe than sorry, hook your function to the
hook