Check is_singular when looking for shortcode content

Closes #11489
This commit is contained in:
Mike Jolley 2016-07-21 13:17:33 +01:00
parent 56f4efc8e3
commit 08941d41b2
2 changed files with 2 additions and 1 deletions

View File

@ -410,5 +410,5 @@ function wc_checkout_is_https() {
function wc_post_content_has_shortcode( $tag = '' ) {
global $post;
return is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $tag );
return is_singular() && is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $tag );
}

View File

@ -159,6 +159,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
= 2.7.0 =
* Respect stock status and prevent the "out of stock threshold" setting affecting existing in-stock products.
* Added Nigerian Provinces to i18n/state.
[See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce/master/CHANGELOG.txt).