From 22fc69ea2497073e969d5bd9d3a12cf6db9a5327 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 19 Dec 2007 18:05:21 +0000 Subject: [PATCH] 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 --- wp-includes/link-template.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 7587454bd..036f115b2 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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 );