WordPress add page under admin submenu and retaining the active status of the parent submenu page in the menu

If I understand it correctly — you want the “Plans” sub-menu to be highlighted when on the “Add/edit plans” (pxmag-plans-edit) page, then you can do it like so: Use the add_menu_classes hook to highlight the pxmag-menu menu: function my_add_menu_classes( $menu ) { // Do nothing if not on the “Add/edit plans” page. global $plugin_page; if … Read more

How to align the top of an admin pointer to the target element?

that’s a great question, Alex! Not exactly an answer to the question, but the following will work: jQuery(‘#menu-settings’).first().pointer( { “content”: “<h3>Pointer header<\/h3>” + “<h4>Pointer subheader<\/h4>” + “<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Levatio igitur vitiorum magna fit in iis, qui habent ad virtutem progressionis aliquantum. Rationis enim perfectio est virtus; Sed ego in … Read more

Visiting a console submenu page does not expand its parent menu item

You can use the parent_file hook to ensure the TDLRM menu is expanded when viewing the “Store users” or “Categories” page. add_filter( ‘parent_file’, ‘wpse_398962_parent_file’ ); function wpse_398962_parent_file( $parent_file ) { global $submenu_file, $typenow; // 1: This is for highlighting the TDLRM » “Store users” submenu. if ( ‘users.php’ === $parent_file && ! $submenu_file && isset( … Read more

Additional menu item popping in submenus

The third menu item that appears (in fact, the first) is the main menu: add_action(‘admin_menu’, ‘Ad_menu’); function Ad_menu() { //Main menu add_menu_page( ‘Ads page title’, ‘Ads menu title’, ‘manage_options’, ‘ad_menu_slug’, function(){ echo ‘<h1>Main menu</h1>’; } ); //Submenus add_submenu_page( ‘ad_menu_slug’, ‘View page title’, ‘View menu title’, ‘manage_options’, ‘ad_view_slug’, // <– Put main menu slug here function(){ … Read more

How to rename Profile link in wp-admin page

Changing the menu title is easy enough, you just need to place this in your functions.php file – add_action(‘admin_menu’, ‘my_change_admin_menu’); function my_change_admin_menu(){ global $menu; $menu[70][0] = ‘New profile menu title’; } However, you cannot change the title of this page via WordPress, not the update button text, but if you really need to do so … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)