do_feed_<feed>

Fires once the given feed is loaded.

Description

do_action( 'do_feed_<feed>', (bool) $wp_query_is_comment_feed, (string) $feed ); 

The dynamic portion(s) of the hook name refer to the feed template name. Possible values include: rdf,, rss., rss2, and atom.

Parameters (2)

0. $wp_query_is_comment_feed (bool)
Whether the feed is a comment feed.
1. $feed (string)
The feed name.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'do_feed_{$feed}', $wp_query_is_comment_feed, $feed ); 
The following example is for adding a hook callback.
  1. // define the do_feed_<feed> callback 
  2. function action_do_feed_feed( $wp_query_is_comment_feed, $feed ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "do_feed_{$feed}", 'action_do_feed_feed', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "do_feed_{$feed}", 'action_do_feed_feed', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/functions.php  
  1. do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed );