wp_admin_bar_updates_menu

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

Description

wp_admin_bar_updates_menu( (WP_Admin_Bar) $wp_admin_bar ); 

Parameters (1)

0. $wp_admin_bar (WP_Admin_Bar)
The wp admin bar.

Usage

  1. if ( !function_exists( 'wp_admin_bar_updates_menu' ) ) { 
  2. require_once ABSPATH . WPINC . '/admin-bar.php'; 
  3.  
  4. // The wp admin bar. 
  5. $wp_admin_bar = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_admin_bar_updates_menu($wp_admin_bar); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/admin-bar.php  
  1. function wp_admin_bar_updates_menu( $wp_admin_bar ) { 
  2.  
  3. $update_data = wp_get_update_data(); 
  4.  
  5. if ( !$update_data['counts']['total'] ) 
  6. return; 
  7.  
  8. $title = '<span class="ab-icon"></span><span class="ab-label">' . number_format_i18n( $update_data['counts']['total'] ) . '</span>'; 
  9. $title .= '<span class="screen-reader-text">' . $update_data['title'] . '</span>'; 
  10.  
  11. $wp_admin_bar->add_menu( array( 
  12. 'id' => 'updates',  
  13. 'title' => $title,  
  14. 'href' => network_admin_url( 'update-core.php' ),  
  15. 'meta' => array( 
  16. 'title' => $update_data['title'],  
  17. ),  
  18. ) );