呈现事件和新闻仪表板小部件。

原型

wp_dashboard_events_news()

源文件

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

<?php
...
function wp_dashboard_events_news() {
	wp_print_community_events_markup();
	?>
	<div class="wordpress-news hide-if-no-js">
		<?php wp_dashboard_primary(); ?>
	</div>
	<p class="community-events-footer">
		<?php
			printf(
				'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
				'https://make.wordpress.org/community/meetups-landing-page',
				__( 'Meetups' ),
				/* translators: accessibility text */
				__( '(opens in a new window)' )
			);
		?>
		|
		<?php
			printf(
				'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
				'https://central.wordcamp.org/schedule/',
				__( 'WordCamps' ),
				/* translators: accessibility text */
				__( '(opens in a new window)' )
			);
		?>
		|
		<?php
			printf(
				'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
				/* translators: If a Rosetta site exists (e.g. https://es.wordpress.org/news/), then use that. Otherwise, leave untranslated. */
				esc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),
				__( 'News' ),
				/* translators: accessibility text */
				__( '(opens in a new window)' )
			);
		?>
	</p>
	<?php
}
...
?>

其他

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