本文介绍了删除子菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从WordPress的管理菜单中删除一些子菜单项.我发现以下内容可以删除某些子菜单项...

I want to remove a few sub menu items from the admin menu in WordPress. I have found the following which can remove certain sub menu items...

add_action( 'admin_menu', 'adjust_the_wp_menu', 999 );
function adjust_the_wp_menu() {
  $page = remove_submenu_page( 'themes.php', 'widgets.php' );
}

...但是如果我不是要删除的标准php(例如"themes.php?page = custom-header"),该怎么办.

...but what if it is not a standard php such as "themes.php?page=custom-header" that I would like removed.

推荐答案

Remove "themes.php?page=custom-header" option using this code.


function remove_twentyeleven_options() {
    remove_custom_image_header();
}
add_action( 'after_setup_theme','remove_twentyeleven_options', 100 );

这篇关于删除子菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 04:03