A simple hook to add your own buttons to the WordPress admin bar.
Add the following into your functions.php file and you’re ready to go!
/* Add Admin Bar Button */ add_action('admin_bar_menu', 'add_admin_bar_button', 100); function add_admin_bar_button($admin_bar){ $admin_bar->add_menu( array( 'id' => 'my-button-id', 'title' => 'My Button', 'href' => 'https://www.mylink.com/', 'meta' => array( 'title' => __('My Button'), 'target' => '_blank', ), )); }