下面的函数应该对您有所帮助。它将从“外观”菜单项中删除默认菜单项,并在仪表板中删除一个新菜单项。
add_action( \'admin_menu\', \'fb_customize_admin_menu_hide\', 999 );
function fb_customize_admin_menu_hide(){
global $submenu;
// Remove Appearance - Customize Menu
unset( $submenu[ \'themes.php\' ][ 6 ] );
// Create URL.
$customize_url = add_query_arg(
\'return\',
urlencode( wp_unslash( $_SERVER[\'REQUEST_URI\'] ) ),
\'customize.php\'
);
// Add sub menu page to the Dashboard menu.
add_dashboard_page(
__( \'Customize\' ),
__( \'Customize\' ),
\'customize\',
esc_url( $customize_url ),
\'\'
);
}
您应该将其复制到一个小插件中,并在安装中激活。