Store recent sales eligibility transient as string

This commit is contained in:
Eric Jinks 2022-05-10 04:02:10 +10:00
parent 3d68850d78
commit ae954f3cc5
No known key found for this signature in database
GPG Key ID: 22C09ACBC4DC9279
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ class WcPaySubscriptionsPage {
// Valid cache found.
if ( false !== $is_eligible ) {
return $is_eligible;
return 'eligible' === $is_eligible;
}
// Get a single order that was marked as completed within the last 30 days.
@ -139,10 +139,10 @@ class WcPaySubscriptionsPage {
)
);
$is_eligible = count( $orders ) >= 1;
$is_eligible = count( $orders ) >= 1 ? 'eligible' : 'not_eligible';
set_transient( $transient_key, $is_eligible, DAY_IN_SECONDS );
return $is_eligible;
return 'eligible' === $is_eligible;
}
/**