wp_admin_bar_updates_menu

Advertisement

Summery Summery

Provide an update link if theme/plugin/core updates are available.

Syntax Syntax

wp_admin_bar_updates_menu( WP_Admin_Bar $wp_admin_bar )

Parameters Parameters

$wp_admin_bar

(WP_Admin_Bar) (Required)

Source Source

File: wp-includes/admin-bar.php

function wp_admin_bar_updates_menu( $wp_admin_bar ) {

	$update_data = wp_get_update_data();

	if ( ! $update_data['counts']['total'] ) {
		return;
	}

	$title  = '<span class="ab-icon"></span><span class="ab-label">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>';
	$title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>';

	$wp_admin_bar->add_node(
		array(
			'id'    => 'updates',
			'title' => $title,
			'href'  => network_admin_url( 'update-core.php' ),
			'meta'  => array(
				'title' => $update_data['title'],
			),
		)
	);
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.