Adding A Notification Bubble To An Admin Menu Item

You’ve probably seen the small notification bubble that shows up in the Dashboard menu when a new update is available. Here’s how you can add a menu bubble to your own custom menu:

function add_menu_with_notification_bubble() {
	$bubble = sprintf(
		' <span class="update-plugins"><span class="update-count">%d</span></span>',
		42 //bubble contents
		'Example Menu',
		'Example Menu' . $bubble,
add_action('admin_menu', 'add_menu_with_notification_bubble');

The resulting menu will look like this:

Related posts :

Leave a Reply