[theme-reviewers] wrapping functions with if( ! function_exists() ) {…}

Bego Mario Garde pixolin at yahoo.com
Sat Oct 11 15:19:24 UTC 2014


I have another question, this time regarding the usage of

  if( !function_exists()) {…}

for non-core theme-functions.

Otto (Samuel Wood) explained very well on

"The if function_exists approach allows for a child theme to override
the function definition by simply defining the function themselves.
Since child theme's functions.php files load first, then they will
define the function first and the parent's definition will not get loaded."

Chip Bennet defined on

"No core WordPress functions introduced prior to one previous, major
WordPress release are wrapped in function_exists() conditionals."

Yet I miss this being mentioned in the theme review guidelines nor do I
know whether wrapping functions is only *recommended* or even *required*.

Could someone please explain how I should deal with it?

Thank you, Bego (@pixolin)

More information about the theme-reviewers mailing list