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
ea6e7295ec
commit
e03c51c5ed
|
@ -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/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
* @version 9.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product;
|
||||
|
||||
// Ensure visibility.
|
||||
if ( empty( $product ) || ! $product->is_visible() ) {
|
||||
// Check if the product is a valid WooCommerce product and ensure its visibility before proceeding.
|
||||
if ( ! is_a( $product, WC_Product::class ) || ! $product->is_visible() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue