Hot answers tagged

5

Just create a "placeholder" menu that you can then assign all your post types to: function wpse_226690_admin_menu() { add_menu_page( 'Events Manager', 'Events Manager', 'read', 'events-manager', '', // Callback, leave empty 'dashicons-calendar', 1 // Position ); } add_action( 'admin_menu', ...


3

After you have removed the comments bubble, you add it again. The trick is that in the $args of add_node you have to set parent to top-secondary. So it will look like this: add_action( 'admin_bar_menu', 'wpse227079_toolbar_link_to_bubble', 999 ); function wpse227079_toolbar_link_to_bubble ( $wp_admin_bar ) { $args = array( 'id' ...


2

Based on cjbj's answer above, this is what I did... I went to /wp-includes/admin-bar.php and copied the relevant code with a slight modification (see below) into my plugin. Here is the end result: if ( !current_user_can('edit_posts') ) return; $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $awaiting_text = sprintf( ...


2

No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg: add_menu_page ( 'Test Menu', 'Test Menu', 'read', 'testmainmenu', '', '' ); add_submenu_page ( 'testmainmenu', 'Test Menu', 'Child1', 'read', 'child1', ''); The first parameter of the ...


1

I believe you're looking for the network_admin_menu hook. The Codex page for network_admin_menu has the following example: add_action('network_admin_menu', 'function_name'); function function_name() { add_menu_page( "page_title", "menu_title", 'capability', 'menu_slug', 'function_callback' ); }


1

Great question. As far as I can tell there isn't a way to filter this list (there's a long trac ticket about a proposal to, if you're interested, and also related (but different) questions on this site here and here). Because there's no filter, you may have to resort to doing it with jQuery. We can add our own scripts to the admin footer using the ...


1

Quickie Run only when you need to run and only run where you need to run Your code is almost there but you are not running at the particular time,if we use the your code it runs first and then filtered again by WooCommerce. So we have two options. Change priority of the filter Hook the code to run properly I think just unsetting ...


1

One way to move it to the very right would be like this: #wp-admin-bar-comments { float: right !important; } This will put it to the right of the Howdy message. I am not 100% sure if you want it on a specific side.


1

My choice would be to use WP_List_Table. If you continue reading the Codex it makes it clear that it is commonly used by third party code. "Someday" it might go away, but I doubt it will happen abruptly (if at all). If it does change, there will probably be a newer solution to replace it. EDIT: Another thought. if you feel really can't use WP_List_Table ...


1

Why not extend WP_List_Table? It creates responsive tables that collapse to an accordion when the table width exceeds the screen size. See Class Reference/WP List Table. You might take a look at the code in this plugin to get started: Custom List Table Example


1

You can use get_current_screen() to check on which page you are then make a redirect to specific admin page. get_current_screen() return the screen object like WP_Screen Object ( [action] => [base] => dashboard [columns:WP_Screen:private] => 0 [id] => dashboard [in_admin:protected] => site [is_network] => ...



Only top voted, non community-wiki answers of a minimum length are eligible