Determines whether the query is for a feed.
Parameters
$feedsstring|string[]optional- Feed type or array of feed types to check against. Default empty.
Source
public function is_feed( $feeds = '' ) {
if ( empty( $feeds ) || ! $this->is_feed ) {
return (bool) $this->is_feed;
}
$query_var = $this->get( 'feed' );
if ( 'feed' === $query_var ) {
$query_var = get_default_feed();
}
return in_array( $query_var, (array) $feeds, true );
}
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.