php - Use post_type in admin_menu action callback with wordpress


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.




You can do something like this:-

Add following line into yourtheme's functions.php file:-

remove_post_type_support( 'location', 'thumbnail' );

This will only effect yourlocation post type.

Hope it will help you.

People are also looking for solutions to the problem: php - Paypal Payment Standard Order data not recieve when payment success


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.