get_search_comments_feed_link()
get_search_comments_feed_link( string $search_query = ”…
get_search_comments_feed_link( string $search_query = ”, string $feed = ” )
检索搜索结果注释提要的永久链接。
Retrieves the permalink for the search results comments feed.
检索搜索结果注释提要的永久链接。
Retrieves the permalink for the search results comments feed.
目录锚点:#参数#返回#源码
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $search_query | (string) | 可选 | 搜索查询。 |
| $feed | (string) | 可选 | 进给类型。可能的值包括“rss2”、“atom”。Default是get_Default_feed()的值。 |
返回(Return)
(string)注释提要搜索结果永久链接。
源码(Source)
/**
* Retrieve the permalink for the comments feed of the search results.
*
* @since 2.5.0
*
* @global WP_Rewrite $wp_rewrite
*
* @param string $search_query Optional. Search query.
* @param string $feed Optional. Feed type.
* @return string The comments feed search results permalink.
*/
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' );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.5.0 | wp-includes/link-template.php:1181 | 0 | 6 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!