返回介绍

wp_dashboard_primary()

发布于 2017-09-11 11:45:41 字数 3995 浏览 897 评论 0 收藏 0

wp_dashboard_primary()

WordPress News dashboard widget.


description


源代码

File: wp-admin/includes/dashboard.php

function wp_dashboard_primary() {
	$feeds = array(
		'news' => array(

			/**
			 * Filters the primary link URL for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.5.0
			 *
			 * @param string $link The widget's primary link URL.
			 */
			'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),

			/**
			 * Filters the primary feed URL for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.3.0
			 *
			 * @param string $url The widget's primary feed URL.
			 */
			'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),

			/**
			 * Filters the primary link title for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.3.0
			 *
			 * @param string $title Title attribute for the widget's primary link.
			 */
			'title'        => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
			'items'        => 1,
			'show_summary' => 0,
			'show_author'  => 0,
			'show_date'    => 0,
		),
		'planet' => array(

			/**
			 * Filters the secondary link URL for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.3.0
			 *
			 * @param string $link The widget's secondary link URL.
			 */
			'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),

			/**
			 * Filters the secondary feed URL for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.3.0
			 *
			 * @param string $url The widget's secondary feed URL.
			 */
			'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),

			/**
			 * Filters the secondary link title for the 'WordPress News' dashboard widget.
			 *
			 * @since 2.3.0
			 *
			 * @param string $title Title attribute for the widget's secondary link.
			 */
			'title'        => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),

			/**
			 * Filters the number of secondary link items for the 'WordPress News' dashboard widget.
			 *
			 * @since 4.4.0
			 *
			 * @param string $items How many items to show in the secondary feed.
			 */
			'items'        => apply_filters( 'dashboard_secondary_items', 3 ),
			'show_summary' => 0,
			'show_author'  => 0,
			'show_date'    => 0,
		)
	);

	wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
}

更新日志

Versiondescription
4.8.0Removed popular plugins feed.
2.7.0Introduced.

相关函数

Uses

  • wp-admin/includes/dashboard.php: dashboard_secondary_items
  • wp-admin/includes/dashboard.php: wp_dashboard_cached_rss_widget()
  • wp-admin/includes/dashboard.php: dashboard_primary_link
  • wp-admin/includes/dashboard.php: dashboard_primary_feed
  • wp-admin/includes/dashboard.php: dashboard_primary_title
  • wp-admin/includes/dashboard.php: dashboard_secondary_link
  • wp-admin/includes/dashboard.php: dashboard_secondary_feed
  • wp-admin/includes/dashboard.php: dashboard_secondary_title
  • wp-includes/l10n.php: __()
  • wp-includes/plugin.php: apply_filters()
  • Show 5 more uses Hide more uses

Used By

  • wp-admin/includes/dashboard.php: wp_dashboard_events_news()
  • wp-admin/includes/ajax-actions.php: wp_ajax_dashboard_widgets()

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文