Merge pull request #14027 from woocommerce/fix/null-product-json-ld
Make sure we have a product before generating JSON
This commit is contained in:
commit
7efbb3f52e
|
@ -180,6 +180,10 @@ class WC_Structured_Data {
|
|||
global $product;
|
||||
}
|
||||
|
||||
if ( ! is_a( $product, 'WC_Product' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$shop_name = get_bloginfo( 'name' );
|
||||
$shop_url = home_url();
|
||||
$currency = get_woocommerce_currency();
|
||||
|
|
Loading…
Reference in New Issue