Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit a024fd6

Browse files
nerradsenadir
authored andcommitted
check for existence of instance method rather than WC instance itself
1 parent a389601 commit a024fd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/RestApi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function maybe_init_cart_session( $return ) {
6767
$wc_instance = wc();
6868
// if WooCommerce instance isn't available or already have an
6969
// authentication error, just return.
70-
if ( ! $wc_instance instanceof \WooCommerce || \is_wp_error( $return ) ) {
70+
if ( ! method_exists( $wc_instance, 'initialize_session' ) || \is_wp_error( $return ) ) {
7171
return $return;
7272
}
7373
$wc_instance->frontend_includes();

0 commit comments

Comments
 (0)