mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Check if WC Subscriptions exist before proceed
This commit is contained in:
parent
e14e7b24db
commit
7d219bbd14
1 changed files with 4 additions and 0 deletions
|
@ -342,6 +342,10 @@ class SubscriptionModule implements ModuleInterface {
|
|||
add_action(
|
||||
'wp_loaded',
|
||||
function() use ( $c ) {
|
||||
if(! function_exists('wcs_get_subscription')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$cancel_subscription_id = wc_clean( wp_unslash( $_GET['ppcp_cancel_subscription'] ?? '' ) );
|
||||
$subscription = wcs_get_subscription( absint( $cancel_subscription_id ) );
|
||||
if ( ! wcs_is_subscription( $subscription ) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue