do_feed_(feed) хук-событиеWP 2.1.0

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:

Использование

add_action( 'do_feed_(feed)', 'wp_kama_do_feed_action', 10, 2 );

/**
 * Function for `do_feed_(feed)` action-hook.
 * 
 * @param bool   $is_comment_feed Whether the feed is a comment feed.
 * @param string $feed            The feed name.
 *
 * @return void
 */
function wp_kama_do_feed_action( $is_comment_feed, $feed ){

	// action...
}
$is_comment_feed(true|false)
Whether the feed is a comment feed.
$feed(строка)
The feed name.

Список изменений

С версии 2.1.0 Введена.
С версии 4.4.0 The $feed parameter was added.

Где вызывается хук

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

Где используется хук в WordPress

wp-includes/default-filters.php 396
add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 0 );
wp-includes/default-filters.php 397
add_action( 'do_feed_rss', 'do_feed_rss', 10, 0 );
wp-includes/default-filters.php 398
add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
wp-includes/default-filters.php 399
add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );