My submenu page does not show for users with the capability provided while adding the submenu page
My submenu page does not show for users with the capability provided while adding the submenu page
My submenu page does not show for users with the capability provided while adding the submenu page
jQuery(document).ready( function($) { $(‘#toplevel_page_display_strategies ul li:nth-child(3)’).addClass(‘current’) $(‘#toplevel_page_display_strategies’).removeClass(‘wp-not-current-submenu’) $(‘#toplevel_page_display_strategies’).addClass(‘wp-has-current-submenu’) } );
Add new button to WP backend menu
a loop is almost always a good solution to avoid to copy-paste code. you just need to use a array of datas like that : $submenus = [ [ “page_title” => “page1”, “menu_title” => “title1”, “slug” => “wp-admin.php”, ], [ “page_title” => “page2”, “menu_title” => “title2”, “slug” => “wp-login.php”, ], ]; foreach ($submenus as $value) … Read more
It is a valid question and an issue I have encountered as well. I did not go through the WP core code to see why the title is missing, but I can offer a solution using the admin_title filter, for people facing a similar problem: function fix_your_page_title( $admin_title, $title ) { if ( get_current_screen()->id === … Read more
Instead of running to trac and complaining about a missing feature, I suggest to make use of an OOP construct: // File: base.class.php abstract class wpse67649_admin_page_base { public function add_page() { add_submenu_page( null // -> Set to null – will hide menu link ,’Page Title’ // -> Page Title ,’Menu Title’ // -> Title that … Read more
It would go like this (note the absence of the function parameter – and also the capability instead of a role). add_action( ‘admin_menu’, ‘wpse_74421_menu_admin’ ); function wpse_74421_menu_admin() { add_submenu_page( ‘edit.php?post_type=events’, ‘Add Gallery’, ‘Add Gallery’, ‘delete_plugins’, ‘admin.php?page=nggallery-add-gallery’ ); }
I renamed the “SmartPost E-mail” plugin folder so it loads after the “SmartPost” plugin – I think. I’m pretty sure this “weird” behavior has to do with the order in which plugins are loaded. If a plugin is loaded before its “parent” plugin, then the weird behavior mentioned above will probably happen.