如何在admin_menu
的回調函數中訪問post_type
的動作?在admin_menu中使用post_type跟wordpress動作回調
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']);
}
}
我需要隱藏featured image metabox
僅post_type location
。
通過在從支撐陣列刪除縮略圖解決了這個post_type註冊的時間'''支持'=>數組('標題','自定義字段')'' – devo