我试图取消在“页面”上共享选项的选项(但在帖子上保留)。
所以我有一个功能来确保共享选项在页面上始终为no
function page_disable_share($post_id)
{
if ( \'page\' != get_post_type() )
return;
update_post_meta($post_id, "sharing_disabled", 1);
}
add_action(\'save_post\', \'page_disable_share\');
但我不想让meta框出现在那里,如果用户勾选它并且它总是自己解开,可能会让用户感到困惑。function page_remove_share()
{
remove_meta_box( \'sharing_meta\' , \'page\' , \'normal\' );
}
add_action(\'admin_menu\' , \'page_remove_share\');
但这不起作用。也许JetPack在“admin\\u menu”之后被吸引住了?我试过其他钩子(http://codex.wordpress.org/Plugin_API/Action_Reference) 但都不管用。有什么想法吗?