Child Theme Redeclared Functions do not behave as Codex says
-
Sorry for double post. Only just discovered this forum:
In the codex, where it explains the new features of WP 3, it says:TIP FOR THEME DEVELOPERS. The fact that a child theme’s functions.php is loaded first means that you can make the user functions of your theme pluggable—that is, replaceable by a child theme—by declaring them conditionally. E.g.:
if (!function_exists('theme_special_nav')) { function theme_special_nav() { // Do something. } }
However, whenever I try to redeclare a function in a child theme functions.php that is already declared in the parent theme, I get a fatal error ‘Cannot redeclare….etc’.
This happens whether or not I wrap the redeclared function in
if (!function_existsor not.
Is the Codex wrong?
Should I report this as a bug for WP 3?
Or have I misunderstood?I am running WP 3 Beta 2.
Many thanks.
- The topic ‘Child Theme Redeclared Functions do not behave as Codex says’ is closed to new replies.