the_generator

Display the generator XML or Comment for RSS, ATOM, etc.

Description

the_generator( (string) $type ); 

Returns the correct generator type for the requested output format. Allows for a plugin to filter generators overall the filter.

Parameters (1)

0. $type (string)
The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).

Usage

  1. if ( !function_exists( 'the_generator' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export). 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = the_generator($type); 
  9.  

Defined (1)

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

/wp-includes/general-template.php  
  1. function the_generator( $type ) { 
  2. /** 
  3. * Filters the output of the XHTML generator tag for display. 
  4. * @since 2.5.0 
  5. * @param string $generator_type The generator output. 
  6. * @param string $type The type of generator to output. Accepts 'html',  
  7. * 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'. 
  8. */ 
  9. echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n";