atom_enclosure

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

Description

Parameters (1)

0. $link_href_trim_htmlspecialchars_enclosure_0_rel_enclosure_length_trim_enclosure_1_type_trim_enclosure_2_n — Optional. (string) => '' . "\n"
The link href trim htmlspecialchars enclosure 0 rel enclosure length trim enclosure 1 type trim enclosure 2 n.

Usage

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

Defined (1)

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

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