I’m looking for the correct code to use to hide “Sub Menu” items of the Beaver Builder menu on the WordPress Dashboard. I’ve determined how to hide the entire Beaver Builder menu, but I’d like to hide specific submenus like “categories” or “templates,” not the entire Beaver Builder menu. Here’s the code I’m using so far:
++++++++++++++
function hide_menu(){
global $current_user;
$username = $current_user->user_login;
if ($username !== ‘MyUsername’){
remove_menu_page( ‘edit.php?post_type=fl-builder-template’ ); // This code line works
remove_submenu_page( ‘edit.php?post_fl-builder-template’, ‘edit-tags.php?taxonomy=fl-builder-template-category&post_type=fl-builder-template’ ); // This code line does not work
Thanks for the reply. I’ve actually tested countless variations on the submenu line and can’t find what works. While I know there are plenty of plugin options out there, I’m setting up my own WordPress Dashboard Settings Customization plugin and dumping the plugin I’ve previously used for simplicity. Beaver Builder is the only plugin that has stumped me with setting this up.