You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is already a function wrapped by if(!function_exists('function_name')) {}, you can't override it via the plugin because it throws the error below.
But you can safely override that function with the same code used in the plugin with the functions.php file of the child theme without an error. Those kinds of functions should be overridden safely.
The text was updated successfully, but these errors were encountered:
I honestly think that the core use case of this plugin is not to override existing functions, but to add extra PHP handlers and IIFE JavaScript function calls. 😎
While @mxdpeep is correct that this seems to be the more common usage, it would definitely be good to have support for pluggable functions. Currently the duplicate checker checks any functions defined in the snippet against those that already exist. I'm trying to think of a way to detect whether those are pluggable or not. Maybe we could add a manual override to disable the duplicate checker for specific functions/snippets?
On Tue, Jul 5, 2022 at 11:29 AM Shea Bunge ***@***.***> wrote:
While @mxdpeep <https://github.com/mxdpeep> is correct that this seems to
be the more common usage, it would definitely be good to have support for
pluggable functions. Currently the duplicate checker checks any functions
defined in the snippet against those that already exist. I'm trying to
think of a way to detect whether those are pluggable or not. Maybe we could
add a manual override to disable the duplicate checker for specific
functions/snippets?
—
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASMXTNVBAH2KXY224AQQDVSP6AZANCNFSM5O6MMZPA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
If there is already a function wrapped by
if(!function_exists('function_name')) {}
, you can't override it via the plugin because it throws the error below.But you can safely override that function with the same code used in the plugin with the functions.php file of the child theme without an error. Those kinds of functions should be overridden safely.
The text was updated successfully, but these errors were encountered: