Skip to content

Commit

Permalink
WC version from constant should be checked if defined before accessed (
Browse files Browse the repository at this point in the history
  • Loading branch information
unfulvio authored Sep 11, 2024
1 parent 5d7a9dd commit d191d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wcs-dependent-hook-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static function attach_woocommerce_dependent_hooks() {
foreach ( self::$dependent_callbacks['woocommerce'] as $wc_version => $operators ) {
foreach ( $operators as $operator => $callbacks ) {

if ( ! version_compare( WC_VERSION, $wc_version, $operator ) ) {
if ( ! defined( 'WC_VERSION' ) || ! version_compare( WC_VERSION, $wc_version, $operator ) ) {
continue;
}

Expand Down

0 comments on commit d191d74

Please sign in to comment.