Ensure woocommerce_order_actions callback could accept one single parameter

This commit is contained in:
Emili Castells Guasch 2024-02-19 11:14:42 +01:00
parent 0bdbe116b3
commit 6d47656d1f

View file

@ -196,7 +196,7 @@ class PayPalSubscriptionsModule implements ModuleInterface {
*
* @psalm-suppress MissingClosureParamType
*/
function( $actions, $subscription ): array {
function( $actions, $subscription = null ): array {
if ( ! is_array( $actions ) || ! is_a( $subscription, WC_Subscription::class ) ) {
return $actions;
}