Category WordPress

WordPress: How to Add a Button in the Admin Bar

This snippet will add a button on the admin bar: add_action( ‘admin_bar_menu’, array( $this, ‘addToggleButton’ ), 99 ); public function addToggleButton( $adminBar ) { $args = array( ‘id’ => ‘my_button’, ‘title’ => ‘My Button’, ‘href’ => ‘#’, ‘meta’ => array(…