wp_dashboard_site_activity

Callback function for Activity widget.

Description

wp_dashboard_site_activity(); 

Usage

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

Defined (1)

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

/wp-admin/includes/dashboard.php  
  1. function wp_dashboard_site_activity() { 
  2.  
  3. echo '<div id="activity-widget">'; 
  4.  
  5. $future_posts = wp_dashboard_recent_posts( array( 
  6. 'max' => 5,  
  7. 'status' => 'future',  
  8. 'order' => 'ASC',  
  9. 'title' => __( 'Publishing Soon' ),  
  10. 'id' => 'future-posts',  
  11. ) ); 
  12. $recent_posts = wp_dashboard_recent_posts( array( 
  13. 'max' => 5,  
  14. 'status' => 'publish',  
  15. 'order' => 'DESC',  
  16. 'title' => __( 'Recently Published' ),  
  17. 'id' => 'published-posts',  
  18. ) ); 
  19.  
  20. $recent_comments = wp_dashboard_recent_comments(); 
  21.  
  22. if ( !$future_posts && !$recent_posts && !$recent_comments ) { 
  23. echo '<div class="no-activity">'; 
  24. echo '<p class="smiley" aria-hidden="true"></p>'; 
  25. echo '<p>' . __( 'No activity yet!' ) . '</p>'; 
  26. echo '</div>'; 
  27.  
  28. echo '</div>';