Make WordPress Core

Ticket #5442: search_feed_links.patch

File search_feed_links.patch, 1.1 KB (added by ionfish, 18 years ago)
  • wp-includes/link-template.php

     
    397397        return $link;
    398398}
    399399
     400function get_search_feed_link($search_query = '', $feed = '') {
     401        if ( empty($search_query) )
     402                $search = attribute_escape(get_search_query());
     403        else
     404                $search = attribute_escape(stripslashes($search_query));
     405       
     406        if ( empty($feed) )
     407                $feed = get_default_feed();
     408       
     409        $link = get_option('home') . "?s=$search&feed=$feed";
     410       
     411        $link = apply_filters('search_feed_link', $link);
     412       
     413        return $link;
     414}
     415
     416function get_search_comments_feed_link($search_query = '', $feed = '') {
     417        if ( empty($search_query) )
     418                $search = attribute_escape(get_search_query());
     419        else
     420                $search = attribute_escape(stripslashes($search_query));
     421       
     422        if ( empty($feed) )
     423                $feed = get_default_feed();
     424       
     425        $link = get_option('home') . "?s=$search&feed=comments-$feed";
     426       
     427        $link = apply_filters('search_feed_link', $link);
     428       
     429        return $link;
     430}
     431
    400432function get_edit_post_link( $id = 0 ) {
    401433        $post = &get_post( $id );
    402434