Filter hook 'rss_enclosure'

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

View Source

rss_enclosure

Filter Hook
Description
Filters the RSS enclosure HTML link tag for the current post.

Hook Information

File Location wp-includes/feed.php View on GitHub
Hook Type Filter
Line Number 500

Hook Parameters

Type Name Description
string $html_link_tag The HTML link tag with a URI and other attributes.

Usage Examples

Basic Usage
<?php
// Hook into rss_enclosure
add_filter('rss_enclosure', 'my_custom_filter', 10, 1);

function my_custom_filter($html_link_tag) {
    // Your custom filtering logic here
    return $html_link_tag;
}

Source Code Context

wp-includes/feed.php:500 - How this hook is used in WordPress core
<?php
 495  				 *
 496  				 * @since 2.2.0
 497  				 *
 498  				 * @param string $html_link_tag The HTML link tag with a URI and other attributes.
 499  				 */
 500  				echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
 501  			}
 502  		}
 503  	}
 504  }
 505  

PHP Documentation

<?php
/**
				 * Filters the RSS enclosure HTML link tag for the current post.
				 *
				 * @since 2.2.0
				 *
				 * @param string $html_link_tag The HTML link tag with a URI and other attributes.
				 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/feed.php
Related Hooks

Related hooks will be displayed here in future updates.