The plugin doesn't check if a function can be overridden or not and throw an error
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.
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?
manual override switch looks like a promising solution
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 https://github.com/sheabunge/code-snippets/issues/123#issuecomment-1174837545, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASMXTNVBAH2KXY224AQQDVSP6AZANCNFSM5O6MMZPA . You are receiving this because you were mentioned.Message ID: @.***>