I'm working with wordpress and I search to modify plugin functions without editing the plugin for not break function after update.
But I didn't find solution yet. Can you help me ?
Thanks in advance
I have encountered this issue many times. As others have said, you cannot modify PHP functions. Extending the class will not work because the plugin will instantiate the original class, not your extended version.
The best solution (has worked for me several times) is to add hooks to the existing plugin and submit back to the original author as follows:
git
control locally. You may need to do a diff or rollback later. git diff
to save the patch so you can re-apply it later. Submit the patch to the original plugin author and hope for the best. If you stuck with just actions and filters, the author will most likely accept your changes immediately.git rebase
to replay the changes you made after updating the plugin.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With