目录
描述
译文
在搜索结果中检索评论feed的永久链接
原文
Retrieve the permalink for the comments feed of the search results.
用法
<?php get_search_comments_feed_link( $search_query, $feed ) ?>
参数
$search_query
(string) (可选) Url search query.
默认值: ''
$feed
(string) (可选) Feed type.
默认值: ''
返回值
注意
- 使用到: get_search_query() if no query supplied.
历史
添加于 版本: 2.5.0
源文件
get_search_comments_feed_link() 函数的代码位于 wp-includes/link-template.php
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/* ---------------------------------- * wordpress之魂 © http://wphun.com * ---------------------------------- */ /** * 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' ); } |
- 原文:http://codex.wordpress.org/Function_Reference/get_search_comments_feed_link
- 翻译:黄聪@WordPress之魂