Fixed call to member function is_visible Fatal Error (#51286)
* Fixed call to member function is_visible Fatal Error * Implemented the suggestions * Add changefile(s) from automation for the following project(s): woocommerce * Updated the @version tag * Promote 'comment' to actual changelog entry. * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
parent
04872e31f2
commit
1feb5af079
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Fixed call to a member function is_visible() on string | content-product.php:23
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
*
|
*
|
||||||
* @see https://woocommerce.com/document/template-structure/
|
* @see https://woocommerce.com/document/template-structure/
|
||||||
* @package WooCommerce\Templates
|
* @package WooCommerce\Templates
|
||||||
* @version 3.6.0
|
* @version 9.4.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined( 'ABSPATH' ) || exit;
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
global $product;
|
global $product;
|
||||||
|
|
||||||
// Ensure visibility.
|
// Check if the product is a valid WooCommerce product and ensure its visibility before proceeding.
|
||||||
if ( empty( $product ) || ! $product->is_visible() ) {
|
if ( ! is_a( $product, WC_Product::class ) || ! $product->is_visible() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue