rss_enclosure

Filters the RSS enclosure HTML link tag for the current post.

Description

Parameters (1)

0. $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n — Optional. (string) => '' . "\n"
The enclosure url trim htmlspecialchars enclosure 0 length trim enclosure 1 type type n.

Usage

To run the hook, copy the example below.
  1. $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n = apply_filters( 'rss_enclosure', $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n ); 
  2.  
  3. if ( !empty( $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the rss_enclosure callback 
  2. function filter_rss_enclosure( $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n ) { 
  3. // make filter magic happen here... 
  4. return $enclosure_url_trim_htmlspecialchars_enclosure_0_length_trim_enclosure_1_type_type_n
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'rss_enclosure', 'filter_rss_enclosure', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'rss_enclosure', 'filter_rss_enclosure', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/feed.php  
  1. echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" );