Action hook 'rss_tag_pre'

in WP Core File wp-includes/feed-rss2.php at line 21

View Source

rss_tag_pre

Action Hook
Description
Fires between the xml and rss tags in a feed.

Hook Information

File Location wp-includes/feed-rss2.php View on GitHub
Hook Type Action
Line Number 21

Hook Parameters

Type Name Description
string $context Type of feed. Possible values include 'rss2', 'rss2-comments', 'rdf', 'atom', and 'atom-comments'.

Usage Examples

Basic Usage
<?php
// Hook into rss_tag_pre
add_action('rss_tag_pre', 'my_custom_function', 10, 1);

function my_custom_function($context) {
    // Your custom code here
}

Source Code Context

wp-includes/feed-rss2.php:21 - How this hook is used in WordPress core
<?php
  16   * @since 4.0.0
  17   *
  18   * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
  19   *                        'rdf', 'atom', and 'atom-comments'.
  20   */
  21  do_action( 'rss_tag_pre', 'rss2' );
  22  ?>
  23  <rss version="2.0"
  24  	xmlns:content="http://purl.org/rss/1.0/modules/content/"
  25  	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  26  	xmlns:dc="http://purl.org/dc/elements/1.1/"

PHP Documentation

<?php
/**
 * Fires between the xml and rss tags in a feed.
 *
 * @since 4.0.0
 *
 * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
 *                        'rdf', 'atom', and 'atom-comments'.
 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/feed-rss2.php
Related Hooks

Related hooks will be displayed here in future updates.