Only append generator tag on HTML pages Closes #5113

This commit is contained in:
Mike Jolley 2014-03-12 11:53:59 +00:00
parent 911f7f8a46
commit 49b8ad4378
2 changed files with 12 additions and 3 deletions

View File

@ -127,8 +127,16 @@ function wc_products_rss_feed() {
* @access public
* @return void
*/
function wc_generator_tag() {
echo "\n\n" . '<!-- WooCommerce Version -->' . "\n" . '<meta name="generator" content="WooCommerce ' . esc_attr( WC_VERSION ) . '" />' . "\n\n";
function wc_generator_tag( $gen, $type ) {
switch ( $type ) {
case 'html':
$gen .= "\n" . '<meta name="generator" content="WooCommerce ' . esc_attr( WC_VERSION ) . '">';
break;
case 'xhtml':
$gen .= "\n" . '<meta name="generator" content="WooCommerce ' . esc_attr( WC_VERSION ) . '" />';
break;
}
return $gen;
}
/**

View File

@ -22,7 +22,8 @@ add_filter( 'post_class', 'wc_product_post_class', 20, 3 );
* @see wc_generator_tag()
*/
add_action( 'wp_head', 'wc_products_rss_feed' );
add_action( 'wp_head', 'wc_generator_tag' );
add_action( 'get_the_generator_html', 'wc_generator_tag', 10, 2 );
add_action( 'get_the_generator_xhtml', 'wc_generator_tag', 10, 2 );
/**
* Content Wrappers