do_feed_<feed>
Fires once the given feed is loaded.
Description
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.
- // run the action
- do_action( 'do_feed_{$feed}', $wp_query_is_comment_feed, $feed );
- The following example is for adding a hook callback.
- // define the do_feed_<feed> callback
- function action_do_feed_feed( $wp_query_is_comment_feed, $feed ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "do_feed_{$feed}", 'action_do_feed_feed', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed );