WordPress开发者和主题制作者的搜索引擎



wp_admin_bar_updates_menu ›

Since3.1.0
已弃用n/a
wp_admin_bar_updates_menu ( $wp_admin_bar )
参数:
  • (WP_Admin_Bar) $wp_admin_bar
    Required: Yes
定义在:
文档:

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



源码

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_menu( array(
		'id'    => 'updates',
		'title' => $title,
		'href'  => network_admin_url( 'update-core.php' ),
		'meta'  => array(
			'title' => $update_data['title'],
		),
	) );
}