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

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


Hello,

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
http://wordpress.stackexchange.com/questions/111299/why-use-if-function-exists

"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
http://www.chipbennett.net/2011/04/20/a-guide-to-reviewing-themes-for-the-wordpress-theme-repository/


"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