Skip to content

Commit

Permalink
feat: update safeguards
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek committed Feb 21, 2024
1 parent 9535bce commit 5b093a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function update_membership() {
return;
}

if ( ! class_exists( 'WC_Memberships' ) ) {
if ( ! function_exists( 'wc_memberships_get_user_membership' ) || ! function_exists( 'wc_memberships_create_user_membership' ) ) {
return;
}

Expand All @@ -76,7 +76,7 @@ public function update_membership() {

$user_membership = wc_memberships_get_user_membership( $user->ID, $local_plan_id );

if ( ! $user_membership ) {
if ( null === $user_membership ) {
$user_membership = wc_memberships_create_user_membership(
[
'plan_id' => $local_plan_id,
Expand Down

0 comments on commit 5b093a0

Please sign in to comment.