the_generator
Filters the output of the XHTML generator tag, for display.
Использование
add_filter( 'the_generator', 'wp_kama_the_generator_filter', 10, 2 );
/**
* Function for `the_generator` filter-hook.
*
* @param string $generator_type The generator output.
* @param string $type The type of generator to output. Accepts 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
*
* @return string
*/
function wp_kama_the_generator_filter( $generator_type, $type ){
// filter...
return $generator_type;
}
- $generator_type(строка)
- The generator output.
- $type(строка)
- The type of generator to output. Accepts 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
Список изменений
| С версии 2.5.0 | Введена. |
Где вызывается хук
the_generator
wp-includes/general-template.php 5137
echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "\n";