Managing the admin toolbar items

Default items in the admin toolbar are designed to suit generic blogs or websites, and hence it's a must to customize the toolbar items to suit web applications. The profile section in the top-right corner is suitable for any kind of application as it contains common functionalities such as the editing profile, log out, and setting a profile picture. Hence, our focus should be on the menu items on the left side of the toolbar. First, we have to identify how menu items are generated in order to make the customizations. So, let's look at the following code for retrieving the available toolbar menu items list:

    add_action( 'wp_before_admin_bar_render', array( $this,      'customize_admin_toolbar' ) ); 

Let's have ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.