wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_dashboard_site_activity › WordPress Function

Since3.8.0
Deprecatedn/a
› wp_dashboard_site_activity ( No parameters )
Defined at:
Codex:
Change Log:
  • 7.2.0

Outputs the Activity widget.

Callback function for {@see 'dashboard_activity'}.


Source

function wp_dashboard_site_activity() {

	echo '<div id="activity-widget">';

	$on_this_day_posts = wp_dashboard_on_this_day_get_posts();
	$future_posts      = wp_dashboard_recent_posts(
		array(
			'max'    => 5,
			'status' => 'future',
			'order'  => 'ASC',
			'title'  => __( 'Publishing Soon' ),
			'id'     => 'future-posts',
		)
	);
	$recent_posts      = wp_dashboard_recent_posts(
		array(
			'max'     => 5,
			'status'  => 'publish',
			'order'   => 'DESC',
			'title'   => __( 'Recently Published' ),
			'id'      => 'published-posts',
			'exclude' => wp_list_pluck( $on_this_day_posts, 'ID' ),
		)
	);

	$on_this_day_rendered = wp_dashboard_on_this_day( $on_this_day_posts );

	if ( ! $future_posts && ! $recent_posts && ! $on_this_day_rendered ) {
		echo '<div class="no-activity">';
		echo '<p>' . __( 'No activity yet!' ) . '</p>';
		echo '</div>';
	}

	echo '</div>';
}