mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Ensure WooCommerce Subscriptions plugin functions exist
This commit is contained in:
parent
895cc486d4
commit
26c9733181
5 changed files with 13 additions and 6 deletions
|
@ -233,6 +233,10 @@ class SubscriptionModule implements ModuleInterface {
|
|||
* @psalm-suppress MissingClosureParamType
|
||||
*/
|
||||
function( string $post_type, $post_or_order_object ) use ( $c ) {
|
||||
if ( ! function_exists( 'wcs_get_subscription' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$order = ( $post_or_order_object instanceof WP_Post )
|
||||
? wc_get_order( $post_or_order_object->ID )
|
||||
: $post_or_order_object;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue