jetpack_print_sitemap

Filter sitemap before rendering it as XML.

Description

apply_filters( 'jetpack_print_sitemap', (SimpleXMLElement) $simplexml_load_string, (string) $buffer_last_modified ); 

Parameters (2)

0. $simplexml_load_string (SimpleXMLElement) => simplexml_load_string( $buffer->contents() )
The simplexml load string.
1. $buffer_last_modified (string)
Date of last modification.

Usage

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

Defined (1)

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

/modules/sitemaps/sitemap-builder.php  
  1. $tree = apply_filters(