get_search_feed_link and get_search_comments_feed_link from ionfish. fixes #5442

git-svn-id: http://svn.automattic.com/wordpress/trunk@6413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-12-19 18:05:21 +00:00
parent f4b80af89a
commit 22fc69ea24
1 changed files with 32 additions and 0 deletions

View File

@ -397,6 +397,38 @@ function get_tag_feed_link($tag_id, $feed = '') {
return $link;
}
function get_search_feed_link($search_query = '', $feed = '') {
if ( empty($search_query) )
$search = attribute_escape(get_search_query());
else
$search = attribute_escape(stripslashes($search_query));
if ( empty($feed) )
$feed = get_default_feed();
$link = get_option('home') . "?s=$search&feed=$feed";
$link = apply_filters('search_feed_link', $link);
return $link;
}
function get_search_comments_feed_link($search_query = '', $feed = '') {
if ( empty($search_query) )
$search = attribute_escape(get_search_query());
else
$search = attribute_escape(stripslashes($search_query));
if ( empty($feed) )
$feed = get_default_feed();
$link = get_option('home') . "?s=$search&feed=comments-$feed";
$link = apply_filters('search_feed_link', $link);
return $link;
}
function get_edit_post_link( $id = 0 ) {
$post = &get_post( $id );