Adding admin top-level menus

You can change the first Submenu text with the following script: function __test_menu() { global $submenu; //var_dump($submenu); //check yourself $submenu[‘unc_gallery_admin_menu’][0][0] = __( ‘Test’, ‘textdomain’ ); } add_action( ‘admin_menu’, ‘__test_menu’ ); Please note, your plugin is error-prone, throwing warning messages. Always develop things with WP_DEBUG to true. And don’t write hardcore texts, better write them in … Read more

Is it possible to add 3 level menu item to admin menu?

While the main admin menus (i.e., those on the left-hand side of the screen) can only be 2 deep (A > B), nodes in the toolbar can be arbitrarily deep. I don’t know if using the toolbar would be a suitable workaround for you, but if so, then you could do something like: add_action (‘wp_before_admin_bar_render’, … Read more

What’s the correct way of moving a menu page to a submenu

By adding post_type to add_submenu_page menu slug it will active CPT page menu. then you have to add parent page as that CPT to that commnet page by using submenu_file filter. # Move comment to CPT function wpse354847_relocate_comments_in_admin_menu() { // Remove existing parent menu. remove_menu_page( ‘edit-comments.php’ ); // Move Comments under Complaints (‘complaint’). add_submenu_page( ‘edit.php?post_type=complaint’, … Read more

Create dynamic wordrpess blank page

Try something like this: in the load hook, you can ouput your xml code. u function my_menu_pages() { $hook = add_submenu_page( null, ‘Page Title’, ‘Page Title’, ‘administrator’, ‘sub-menu-slug’, function() { } ); add_action(‘load-‘ . $hook, function() { // add your xml code here, // you will get a blank page to start with exit; }); … Read more

‘Headers already sent’ Error When Redirecting from add_submenu_page() Callback

Background The infamous “Headers already sent” error rears it’s ugly head in circumstances where something attempts to modify the HTTP headers for the server’s response after they have already been dispatched to the browser – that is to say, when the server should only be generating the body of the response. This often happens in … Read more

WordPress admin menu formatting issue

Otto has suggested a fix in Chrome itself until the bug is resolved: Go to chrome://flags/#disable-slimming-paint Enable the “Disable slimming paint” option. Ensure that the “Enable slimming paint” option below it is not turned on. Relaunch Chrome. If you don’t want to take this approach you can fix this with CSS: function chromefix_inline_css() { wp_add_inline_style( … Read more

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