织梦CMS - 轻松建站从此开始!

欧博ABG-会员注册-官网网址

欧博娱乐How to remove menu and submenu items in WordPr

时间:2025-08-05 20:44来源: 作者:admin 点击: 0 次
I need to hide / remove a menu and submenu in WordPress backend. Main menu item: admin.php?page=themeit_dashboard Sub menu items: admin.php?page=

I need to hide / remove a menu and submenu in WordPress backend.

Main menu item:

admin.php?page=themeit_dashboard

Sub menu items:

admin.php?page=themeit_dashboard&tab=builder admin.php?page=_options&tab=1 admin.php?page=themeit_dashboard&tab=license

I have tried the code below code, but that does not work. Two of the subpages link to the same page but show different tabs.

function remove_menus(){ if ( !current_user_can( 'manage_options' ) ) { remove_menu_page( 'admin.php?page=themeit_dashboard' ); //themeit remove_submenu_page( 'admin.php?page=themeit_dashboard', 'admin.php?page=themeit_dashboard&tab=builder' ); //themeit remove_submenu_page( 'admin.php?page=_options', 'admin.php?page=_options&tab=1' ); //themeit remove_submenu_page( 'admin.php?page=themeit_dashboard', 'admin.php?page=themeit_dashboard&tab=license' ); //themeit } } add_action( 'admin_menu', 'remove_menus' );

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-06 03:08 最后登录:2025-08-06 03:08
栏目列表
推荐内容