Closed danieldudzic closed 3 weeks ago
Nice workaround, and works as expected. I understand, it's more of a temporary solution, until implementing PCP-1241.
@danieldudzic is there a reason for the mu-plugin, instead of adding that filter directly into the plugin?
From my perspective, adding that code into the Settings.php
file would be a better choice (e.g. in the top of the load()
method). That way, we can adapt, or remove, the logic directly when needed, vs. having a mu-plugin file on client websites that is not required anymore
Nice workaround, and works as expected. I understand, it's more of a temporary solution, until implementing PCP-1241.
Correct, although I'm don't think PCP-1241 will be happening anytime soon.
@danieldudzic is there a reason for the mu-plugin, instead of adding that filter directly into the plugin?
It's basically a test work-around to be able to hook into the filter before it gets executed.
From my perspective, adding that code into the Settings.php file would be a better choice (e.g. in the top of the load() method). That way, we can adapt, or remove, the logic directly when needed, vs. having a mu-plugin file on client websites that is not required anymore.
I would prefer not to pollute the core plugin code with 3rd party compatibility code. All 3rd party compatibility code should live exclusively in the ppcp-compat
module - and unfortunately, I haven't found a good solution to load the add_filter
before it gets called on the Settings with the current order of loading.
I believe this still is an improvement, as WPML customers willing to overwrite settings won't need to modify plugin files, but will be able to add a "fix" externally.
Description
This PR adds a filter
woocommerce_paypal_payments_settings_value
that allows for filtering of plugin settings value.Note
I wasn't able to create a compat filter from the compat modules, as the compat module always executes later.
MU plugin to test
Save the following code to a file, and add it to the
wp-content/mu-plugins
folder:Steps to Test
Pay via PayPal.
Can't find the strings you're looking to translate?
and then on theChoose texts for translation
button.Pay via PayPal.
to translation and actually translate it.