WP_Query::is_feed() – Is the query for a feed?

You appear to be a bot. Output may be restricted

Description

Is the query for a feed?

Usage

$bool = WP_Query::is_feed( $feeds );

Parameters

$feeds
( string|string[] ) optional – Optional. Feed type or array of feed types to check against. Default empty.

Returns

bool Whether the query is for a feed.

Source

File name: wordpress/wp-includes/class-wp-query.php
Lines:

1 to 12 of 12
  public function is_feed( $feeds = '' ) {
    if ( empty( $feeds ) || ! $this->WP_Query::is_feed ) {
      return (bool) $this->WP_Query::is_feed;
    }

    $qv = $this->WP_Query::get( 'feed' );
    if ( 'feed' === $qv ) {
      $qv = get_default_feed();
    }

    return in_array( $qv, (array) $feeds, true );
  }
 

 View on GitHub View on Trac