get_search_comments_feed_link() - WordPress 函数参考中文文档

返回介绍

get_search_comments_feed_link()

发布于 2017-09-11 字数2003 浏览 955 评论 0

get_search_comments_feed_link( string $search_query = '',  string $feed = '' )

Retrieves the permalink for the search results comments feed.


描述


参数

$search_query

(string)
(Optional)
Search query.

Default value: ”

$feed

(string)
(Optional)
Feed type.

Default value: ”


返回值

(string) The comments feed search results permalink.


源代码

File: wp-includes/link-template.php

function get_search_comments_feed_link($search_query = '', $feed = '') {
	global $wp_rewrite;

	if ( empty($feed) )
		$feed = get_default_feed();

	$link = get_search_feed_link($search_query, $feed);

	$permastruct = $wp_rewrite->get_search_permastruct();

	if ( empty($permastruct) )
		$link = add_query_arg('feed', 'comments-' . $feed, $link);
	else
		$link = add_query_arg('withcomments', 1, $link);

	/** This filter is documented in wp-includes/link-template.php */
	return apply_filters( 'search_feed_link', $link, $feed, 'comments' );
}

更新日志

Version 描述
2.5.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    add_query_arg()
  • wp-includes/link-template.php:
    get_search_feed_link()
  • wp-includes/link-template.php:
    search_feed_link
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/feed.php:
    get_default_feed()
  • wp-includes/class-wp-rewrite.php:
    WP_Rewrite::get_search_permastruct()
  • Show 1 more use
    Hide more uses


User Contributed Notes

上一篇:get_screen_icon()

下一篇:get_search_feed_link()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!