👋 hey @mwbdanish
So if I try to use this hook, I get the fatal error,
because arguments are different in different places, this does not following the WordPress rules
Thanks for reaching out about this. As I understand, you are referring to custom code.
This section describes all hooks available to you if you need to manipulate how the Stripe WooCommerce Extension functions.
I hope this is helpful! Please let us know if you have any further questions or concerns.
We will be happy to help you further.
there is a bug in your plugin, I need you to correct that. Please read my above message clearly
Hi @mwbdanish,
Thank you for bringing this to our attention. Could you please share more details about this?
wc_stripe_force_save_source, This filter has been defined with 2 arguments at 3 places but at one place it is defined with one argument
Where do you find it with one argument? Can you describe the exact steps or actions you’re taking when you get the error? Can you share a screenshot of the error, too, please?
Once we learn more about it we’ll be better suited to provide help or guide you in the right direction!
Thanks!
-OP
goto here, includes/class-wc-gateway-stripe.php at line no. 828
you will see this code,
$force_save_source_value = apply_filters( ‘wc_stripe_force_save_source’, false );
as you can see, one argument is passed in the filter here.
Apart from this, there is same filter defined in 3 places with 2 arguments passed
So the problem is that, If I am using the filter, then in the add_filter function, I need to pass the number of arguments but in your case, the same filter is defined with a different number of arguments.
It gives me the fatal error
-
This reply was modified 1 year ago by
mwbdanish.
Hello mwbdanish
Thank you for your reply and further clarification.
Before I create a report and submit it to our devs for review, could you please share the details of the places where this filter is defined with 2 arguments? This information will be vital in the review of any potential bug.
I appreciate your efforts for bringing this to our attention. 🙂
Best regards.
at these places the filter has defined with two arguments
includes/class-wc-gateway-stripe.php at line no. 433
includes/abstracts/abstract-wc-stripe-payment-gateway.php at line no. 811
includes/abstracts/abstract-wc-stripe-payment-gateway.php at line no. 1304
👋 hi @mwbdanish
Thank you for reaching back, clarifying things further, and bringing this to our attention.
Best if you could go ahead with submitting a Pull Request for it, via GitHub.
I hope this is helpful! Please let us know if you have any further questions or concerns.
We will be happy to help you further.