Skip to content

Commit

Permalink
Fix fatal errors when subscription classes are not available (#8823)
Browse files Browse the repository at this point in the history
Co-authored-by: Wesley Rosa <[email protected]>
Co-authored-by: Diego Curbelo <[email protected]>
Co-authored-by: Francesco <[email protected]>
  • Loading branch information
4 people authored and lovo-h committed Aug 1, 2024
1 parent 42579fd commit 5f4c5bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-fatal-errors-when-subscriptions-are-unavailable
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fixing fatal errors when subscription classes are not available
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,10 @@ private function validate_subscription_data( $subscription_data ) {
* @return bool True if store has active WCPay subscriptions, otherwise false.
*/
public static function store_has_active_wcpay_subscriptions() {
if ( ! function_exists( 'wcs_get_subscriptions' ) ) {
return false;
}

$active_wcpay_subscriptions = wcs_get_subscriptions(
[
'subscriptions_per_page' => 1,
Expand Down

0 comments on commit 5f4c5bc

Please sign in to comment.