How to remove an item from menu bar’s +New menu based on User role
How to remove an item from menu bar’s +New menu based on User role
How to remove an item from menu bar’s +New menu based on User role
I think you will achieve what you want by using [get_current_screen()][1] and reading the properties from WP_Screen object returned as needed. In your case, I think you will need $screen->base or maybe $screen->id. According to WordPress Codex: id (string) The unique ID of the screen and base (string) The base type of the screen. For … Read more
I would ensure that your user is an ‘admin’ type. Then I would reinstall WP core files (via the update, if that is available; otherwise you will have to do a selective file transfer so as to not to overwrite your settings). I would also rename the ‘plugins’ folder to ‘xxplugins’ temporarily, to ensure that … Read more
You need to create a submenu page with the same slug as the menu page. E.g. $menu_slug = “my_menu_slug”; $desired_capability = “manage_options”; //Or whatever you need $menu_page_callback = “menu_page_callback_function”; add_menu_page( “Page Title”, “Menu Title”, $desired_capability, $menu_slug, $menu_page_callback ); add_submenu_page( $menu_slug, “Submenu Page Title”, “Submenu Menu Title”, $desired_capability, $menu_slug, $menu_page_callback ); //Note, the 5th and 6th … Read more
I use plugin called ubermenu and have paid for the deluxe version of it. You can customize all types of things within a menu that’s much more extensive than built-in functionality. I think the cost of ten bucks or so is well worth it. Add plugin—-> Ubermenu in search field then install and activate. Then … Read more
How to add a notification next to custom admin menu?
You can try this. add_action( ‘admin_menu’, ‘register_my_custom_menu_page’ ); function register_my_custom_menu_page() { add_menu_page( ‘My Custom Page’, ‘My Custom Page’, ‘manage_options’, ‘my-top-level-slug’, ”, ‘dashicons-menu’, 6 ); add_submenu_page( ‘my-top-level-slug’, ‘My Custom Page’, ‘My Custom Page’, ‘manage_options’, ‘my-top-level-slug’, ‘custom_subpage_first’); add_submenu_page( ‘my-top-level-slug’, ‘My Custom Submenu Page 1’, ‘My Custom Submenu Page’,’manage_options’, ‘my-secondary-slug’, ‘custom_subpage_second’); } function custom_subpage_first() { ?> <div class=”wrap”> … Read more
Unable to add custom page to WordPress admin panel
Hide admin menu items if it is empty
My problem was resolved by creating a sub menu page using add_submenu_page() function. Thanks.