wp_network_dashboard_right_now

The WordPress Core wp network dashboard right now function.

Description

wp_network_dashboard_right_now(); 

Usage

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

Defined (1)

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

/wp-admin/includes/dashboard.php  
  1. function wp_network_dashboard_right_now() { 
  2. $actions = array(); 
  3. if ( current_user_can('create_sites') ) 
  4. $actions['create-site'] = '<a href="' . network_admin_url('site-new.php') . '">' . __( 'Create a New Site' ) . '</a>'; 
  5. if ( current_user_can('create_users') ) 
  6. $actions['create-user'] = '<a href="' . network_admin_url('user-new.php') . '">' . __( 'Create a New User' ) . '</a>'; 
  7.  
  8. $c_users = get_user_count(); 
  9. $c_blogs = get_blog_count(); 
  10.  
  11. /** translators: 1: Number of users on the network */ 
  12. $user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) ); 
  13. /** translators: 1: Number of sites on the network */ 
  14. $blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) ); 
  15.  
  16. /** translators: 1: Text indicating the number of sites on the network, 2: Text indicating the number of users on the network */ 
  17. $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text ); 
  18.  
  19. if ( $actions ) { 
  20. echo '<ul class="subsubsub">'; 
  21. foreach ( $actions as $class => $action ) { 
  22. $actions[ $class ] = "\t<li class='$class'>$action"; 
  23. echo implode( " |</li>\n", $actions ) . "</li>\n"; 
  24. echo '</ul>'; 
  25. ?> 
  26. <br class="clear" /> 
  27.  
  28. <p class="youhave"><?php echo $sentence; ?></p> 
  29.  
  30.  
  31. <?php 
  32. /** 
  33. * Fires in the Network Admin 'Right Now' dashboard widget 
  34. * just before the user and site search form fields. 
  35. * @since MU 
  36. * @param null $unused 
  37. */ 
  38. ?> 
  39.  
  40. <form action="<?php echo network_admin_url('users.php'); ?>" method="get"> 
  41. <p> 
  42. <label class="screen-reader-text" for="search-users"><?php _e( 'Search Users' ); ?></label> 
  43. <input type="search" name="s" value="" size="30" autocomplete="off" id="search-users"/> 
  44. <?php submit_button( __( 'Search Users' ), '', false, false, array( 'id' => 'submit_users' ) ); ?> 
  45. </p> 
  46. </form> 
  47.  
  48. <form action="<?php echo network_admin_url('sites.php'); ?>" method="get"> 
  49. <p> 
  50. <label class="screen-reader-text" for="search-sites"><?php _e( 'Search Sites' ); ?></label> 
  51. <input type="search" name="s" value="" size="30" autocomplete="off" id="search-sites"/> 
  52. <?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?> 
  53. </p> 
  54. </form> 
  55. <?php 
  56. /** 
  57. * Fires at the end of the 'Right Now' widget in the Network Admin dashboard. 
  58. * @since MU 
  59. */ 
  60.  
  61. /** 
  62. * Fires at the end of the 'Right Now' widget in the Network Admin dashboard. 
  63. * @since MU 
  64. */