Activity小部件的回调函数。

原型

wp_dashboard_site_activity()

源文件

路径:wp-admin/includes/dashboard.php

<?php
...
function wp_dashboard_site_activity() {
	echo '<div id="activity-widget">';
	$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',
	) );
	$recent_comments = wp_dashboard_recent_comments();
	if ( !$future_posts && !$recent_posts && !$recent_comments ) {
		echo '<div class="no-activity">';
		echo '<p class="smiley" aria-hidden="true"></p>';
		echo '<p>' . __( 'No activity yet!' ) . '</p>';
		echo '</div>';
	}
	echo '</div>';
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_dashboard_site_activity/