^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数feed_links()用法示例

feed_links( array $args = array() )

Display the links to the general feeds.


描述


参数

$args

(array)
(Optional)
arguments.

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包

Default value: array()


源代码

File: wp-includes/general-template.php

function feed_links( $args = array() ) {
	if ( !current_theme_supports('automatic-feed-links') )
		return;

	$defaults = array(
		/* translators: Separator between blog name and feed type in feed links */
		'separator'	=> _x('»', 'feed link'),
		/* translators: 1: blog title, 2: separator (raquo) */
		'feedtitle'	=> __('%1$s %2$s Feed'),
		/* translators: 1: blog title, 2: separator (raquo) */
		'comstitle'	=> __('%1$s %2$s Comments Feed'),
	);

	$args = wp_parse_args( $args, $defaults );

	/**
	 * Filters whether to display the posts feed link.
	 *
	 * @since 4.4.0
	 *
	 * @param bool $show Whether to display the posts feed link. Default true.
	 */
	if ( apply_filters( 'feed_links_show_posts_feed', true ) ) {
		echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '" href="' . esc_url( get_feed_link() ) . "\" />\n";
	}

	/**
	 * Filters whether to display the comments feed link.
	 *
	 * @since 4.4.0
	 *
	 * @param bool $show Whether to display the comments feed link. Default true.
	 */
	if ( apply_filters( 'feed_links_show_comments_feed', true ) ) {
		echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ) . '" href="' . esc_url( get_feed_link( 'comments_' . get_default_feed() ) ) . "\" />\n";
	}
}

更新日志

Version 描述
2.8.0 Introduced.

相关函数

Uses

  • wp-includes/general-template.php:
    feed_links_show_posts_feed
  • wp-includes/general-template.php:
    feed_links_show_comments_feed
  • wp-includes/theme.php:
    current_theme_supports()
  • wp-includes/l10n.php:
    _x()
  • wp-includes/l10n.php:
    __()
  • wp-includes/formatting.php:
    esc_attr()
  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/general-template.php:
    get_bloginfo()
  • wp-includes/functions.php:
    wp_parse_args()
  • wp-includes/link-template.php:
    get_feed_link()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/feed.php:
    feed_content_type()
  • wp-includes/feed.php:
    get_default_feed()
  • Show 8 more uses


让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈