Action hook 'do_feed_{$feed}'

in WP Core File wp-includes/functions.php at line 1640

View Source

do_feed_{$feed}

Action Hook
Description
Fires once the given feed is loaded. The dynamic portion of the hook name, `$feed`, refers to the feed template name. Possible hook names include: - `do_feed_atom` - `do_feed_rdf` - `do_feed_rss` - `do_feed_rss2`

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Action
Line Number 1640

Hook Parameters

Type Name Description
bool $is_comment_feed Whether the feed is a comment feed.
string $feed The feed name.

Usage Examples

Basic Usage
<?php
// Hook into do_feed_{$feed}
add_action('do_feed_{$feed}', 'my_custom_function', 10, 2);

function my_custom_function($is_comment_feed, $feed) {
    // Your custom code here
}

Source Code Context

wp-includes/functions.php:1640 - How this hook is used in WordPress core
<?php
1635  	 * @since 4.4.0 The `$feed` parameter was added.
1636  	 *
1637  	 * @param bool   $is_comment_feed Whether the feed is a comment feed.
1638  	 * @param string $feed            The feed name.
1639  	 */
1640  	do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed );
1641  }
1642  
1643  /**
1644   * Loads the RDF RSS 0.91 Feed template.
1645   *

PHP Documentation

<?php
/**
	 * Fires once the given feed is loaded.
	 *
	 * The dynamic portion of the hook name, `$feed`, refers to the feed template name.
	 *
	 * Possible hook names include:
	 *
	 *  - `do_feed_atom`
	 *  - `do_feed_rdf`
	 *  - `do_feed_rss`
	 *  - `do_feed_rss2`
	 *
	 * @since 2.1.0
	 * @since 4.4.0 The `$feed` parameter was added.
	 *
	 * @param bool   $is_comment_feed Whether the feed is a comment feed.
	 * @param string $feed            The feed name.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.