update_right_now_message

The WordPress Core update right now message function.

Description

update_right_now_message(); 

Usage

  1. if ( !function_exists( 'update_right_now_message' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/update.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = update_right_now_message(); 
  7.  

Defined (1)

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

/wp-admin/includes/update.php  
  1. function update_right_now_message() { 
  2. $theme_name = wp_get_theme(); 
  3. if ( current_user_can( 'switch_themes' ) ) { 
  4. $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme_name ); 
  5.  
  6. $msg = ''; 
  7.  
  8. if ( current_user_can('update_core') ) { 
  9.  
  10. if ( isset( $cur->response ) && $cur->response == 'upgrade' ) 
  11. $msg .= '<a href="' . network_admin_url( 'update-core.php' ) . '" class="button" aria-describedby="wp-version">' . sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a> '; 
  12.  
  13. /** translators: 1: version number, 2: theme name */ 
  14. $content = __( 'WordPress %1$s running %2$s theme.' ); 
  15.  
  16. /** 
  17. * Filters the text displayed in the 'At a Glance' dashboard widget. 
  18. * Prior to 3.8.0, the widget was named 'Right Now'. 
  19. * @since 4.4.0 
  20. * @param string $content Default text. 
  21. */ 
  22. $content = apply_filters( 'update_right_now_text', $content ); 
  23.  
  24. $msg .= sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name ); 
  25.  
  26. echo "<p id='wp-version-message'>$msg</p>";