WordPress.org

Make WordPress Core

Ticket #15460: 15460.diff

File 15460.diff, 936 bytes (added by nacin, 9 years ago)
  • wp-includes/query.php

     
    309309 * @since 1.5.0
    310310 * @uses $wp_query
    311311 *
     312 * @param string|array $feeds Optional feed types to check.
    312313 * @return bool
    313314 */
    314 function is_feed() {
     315function is_feed( $feeds = '' ) {
    315316        global $wp_query;
    316317
    317         return $wp_query->is_feed();
     318        return $wp_query->is_feed( $feeds );
    318319}
    319320
    320321/**
     
    29362937         *
    29372938         * @since 3.1.0
    29382939         *
     2940         * @param string|array $feeds Optional feed types to check.
    29392941         * @return bool
    29402942         */
    2941         function is_feed() {
    2942                 return (bool) $this->is_feed;
     2943        function is_feed( $feeds = '' ) {
     2944                if ( empty( $feeds ) || ! $this->is_feed )
     2945                        return (bool) $this->is_feed;
     2946                $qv = $this->get( 'feed' );
     2947                if ( 'feed' == $qv )
     2948                        $qv = get_default_feed();
     2949                return in_array( $qv, (array) $feeds );
    29432950        }
    29442951
    29452952        /**