WP:管理画面の左メニューより「新規追加」を削除
[php]
// 管理画面の左メニューから[新規追加]を削除
add_action( ‘admin_menu’, ‘my_admin_menu’ );
function my_admin_menu() {
global $submenu;
foreach ($submenu as $parent => $sub) {
foreach ($sub as $index => $data) {
if ( 0 === strpos( $data[2], ‘post-new.php?post_type=○○○’ ) ) {
unset( $submenu[$parent][$index] );
}
}
}
}
[/php]
add_action( ‘admin_menu’, ‘my_admin_menu’ );
function my_admin_menu() {
global $submenu;
foreach ($submenu as $parent => $sub) {
foreach ($sub as $index => $data) {
if ( 0 === strpos( $data[2], ‘post-new.php?post_type=○○○’ ) ) {
unset( $submenu[$parent][$index] );
}
}
}
}
[/php]