How to get specific page screen ID

I don’t think it’s possible without accessing a global. This seems to work for all pages types, by using the global $_parent_pages with the function get_plugin_page_hookname: function nackle_get_screen_id( $slug ){ global $_parent_pages; $parent = array_key_exists( $slug, $_parent_pages ) ? $_parent_pages[$slug] : ”; return get_plugin_page_hookname( $slug, $parent ); } Usage example: echo nackle_get_screen_id( ‘my-custom-page-key’ ); Edit- … 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

Admin: sub menu doesnt display under apperance when activate my themes

Most of those are controlled by your theme support. The functionality does not come for “free” with WordPress, you need to implement the actual code. Once you have put together the code for your theme to support one of the features you can enable it with add_theme_support. for example, in functions.php: add_action( ‘after_setup_theme’, function () … 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

Add menu page issues (permissions & position)

you can do something like: // create your own page add_menu_page(‘my-page’, ‘My Page’, ‘My Page’, ‘parent-slug’, ‘my_plugin_options’, ”, ’10’); // create the subpage under my-page add_submenu_page(‘parent-slug’, ‘Sidebars’, ‘Sidebars’, ‘manage_options’, __FILE__, array(‘sidebar_generator’,’admin_page’)); Note that the last parameter on add_menu_page is a 10. The higher the number the lower the position of the menu item. HTH

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