WordPress.org

Make WordPress Core

Changeset 6413


Ignore:
Timestamp:
12/19/2007 06:05:21 PM (14 years ago)
Author:
ryan
Message:

get_search_feed_link and get_search_comments_feed_link from ionfish. fixes #5442

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r6365 r6413  
    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 );
Note: See TracChangeset for help on using the changeset viewer.