Looking to add a custom menu item in the Toolbar under <Home icon> <Site Name>?

Just add the following in a Code Snippet and modify as needed:

add_action( 'wp_before_admin_bar_render', 'wpdd_admin_bar_edit' );
/**
 * Add a new item under the (Home icon) site name in the toolbar on the backend.
 */
function wpdd_admin_bar_edit() {
	global $wp_admin_bar;

	$wp_admin_bar->add_menu( array(
		'parent' => 'site-name', // site-name is the ID for home menu so we use it as the parent ID.
		'id' => 'customer_support', // You can add any value here as you are adding something very new here.
		'title' => __( 'Customer Support' ), // The anchor text.
		'href' => 'https://www.paypal.me/sridharkatakam/120usd', // URL to link to. Don't change this. Just kidding.
	));
}

Reference

https://onextrapixel.com/taking-control-of-wordpress-3-0-admin-bar/ via google search.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

You need to be logged in to view and post comments.
Not a member yet? Join here.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: