How can I specify the position of an admin bar item added with $wp_admin_bar->add_menu() or add_node()?

If I am correct these are the default positions: wp_admin_bar_wp_menu – 10 wp_admin_bar_my_sites_menu – 20 wp_admin_bar_site_menu – 30 wp_admin_bar_updates_menu – 40 wp_admin_bar_comments_menu – 60 wp_admin_bar_new_content_menu – 70 wp_admin_bar_edit_menu – 80 small code snippet from what I use: add_action(‘admin_bar_menu’, ‘your_function_name’, 10); The 10 should bring it to the most left side in the adminbar. At moment … Read more

Disable the admin bar

You need to specify the order or number which signifies when the Hook gets fired. In this case I beleive it’s 0 and the filter is: wp_admin_bar_render. The action to remove the function I believe is: remove_action( ‘in_admin_header’, ‘wp_admin_bar_render’, 0); The Function Reference: Function Reference/remove action And here it is in the core file: WordPress … Read more

Make ‘Howdy, [name]’ function as log out button

EDIT: This is obviously not a good idea if you want to be able to update – see comments below As this site explains, you need to replace <?php printf(__(‘Howdy, %2$s!’), ‘profile.php’, $user_identity) ?> in the wordpress admin with in your case the word ‘logout.’ Then make the url be echo wp_logout_url();

Add admin bar link to edit author

You could try this modification of your code: function add_author_edit_link( $wp_admin_bar ) { if ( is_author() && current_user_can( ‘add_users’ ) ) { $args = array( ‘id’ => ‘author-edit’, ‘title’ => __( ‘Edit Author’ ), ‘href’ => admin_url( sprintf( ‘user-edit.php?user_id=%d’, get_queried_object_id() ) ) ); $wp_admin_bar->add_node($args); } } add_action( ‘admin_bar_menu’, ‘add_author_edit_link’, 99 ); where we use the … Read more

Adding a menu item in the admin bar

every menu have an number . lower the number priority. add_action( ‘admin_bar_menu’, ‘wp_admin_bar_sidebar_toggle’, 0 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_wp_menu’, 10 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_sites_menu’, 20 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_site_menu’, 30 ); more clear idea you can check the link below http://natko.com/custom-menu-item-position-in-wordpress-admin-bar-toolbar/

Attaching a navigation menu to the admin bar?

It turns out to be very easy! No need for a special walker, wp_get_nav_menu_items() returns everything you need. This example adds an single root menu item and then the menu, you can do this differently if you want. It maps all extra menu features I could find in the code, I don’t know whether you … Read more

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