Cannot redeclare pluggable function of parent theme
-
Hi,
There’s a pluggable function like this in the parent theme:
<?php if ( ! function_exists ( 'my_function' ) ) { function my_function() { // Contents of the function } } ?>I’m trying to redeclare this function with a custom code snippet as follows:
<?php function my_function() { // Contents of the function } ?>Unfortunately I get:
The code snippet you are trying to save produced a fatal error on line 89: Cannot redeclare my_function() (previously declared in /redacted/wp-content/themes/parenttheme/inc/blog/blog-config.php:100)However when I add the function to the functions.php of the child theme, it works (as intended).
Why is it not possible to redeclare functions with this plugin? It defeats the whole purpose of the plugin when I have to start adding code to the functions.php
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Cannot redeclare pluggable function of parent theme’ is closed to new replies.