<div dir="ltr"><div>The guidelines states: "Themes must not provide backward compatibility for out-of-date WordPress versions (more than two prior major WordPress versions – currently, that means versions prior to WordPress 3.8), including using function_exists() conditional wrappers for current <b>WordPress functions</b>." <a href="https://make.wordpress.org/themes/handbook/guidelines/">https://make.wordpress.org/themes/handbook/guidelines/</a></div><div><br></div><div>This is one thing we require but I could not find in the guidelines.</div><div>"Function calls must be placed inside callbacks and hooked into appropriate actions or filters (such as after_setup_theme for Theme setup functions, or widgets_init for Widgets/dynamic sidebar functions)"<br></div><div><br></div><div>The <b>theme functions</b> can be wrapped in a <font face="arial, sans-serif">if( !function_exists()) {…}. At the moment this is not required nor recommended.</font></div><div><br></div><div>Actually Chris wrote a good answer below Ottos: <a href="http://wordpress.stackexchange.com/a/111318/17937">http://wordpress.stackexchange.com/a/111318/17937</a><br></div><div><br></div><div>P.S I personally don't think every every theme function needs to be wrapped in if( !function_exists()) {…} because depending on the function you can just as well overwrite it with another function hooking into the same hook. If the function was a bit more complex then it would be better to make the function extendable with hooks and filters. So that child theme could change single values instead of having to copy the whole function.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 October 2014 17:19, Bego Mario Garde <span dir="ltr"><<a href="mailto:pixolin@yahoo.com" target="_blank">pixolin@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have another question, this time regarding the usage of<br>
<br>
if( !function_exists()) {…}<br>
<br>
for non-core theme-functions.<br>
<br>
Otto (Samuel Wood) explained very well on<br>
<a href="http://wordpress.stackexchange.com/questions/111299/why-use-if-function-exists" target="_blank">http://wordpress.stackexchange.com/questions/111299/why-use-if-function-exists</a><br>
<br>
"The if function_exists approach allows for a child theme to override<br>
the function definition by simply defining the function themselves.<br>
Since child theme's functions.php files load first, then they will<br>
define the function first and the parent's definition will not get loaded."<br>
<br>
Chip Bennet defined on<br>
<a href="http://www.chipbennett.net/2011/04/20/a-guide-to-reviewing-themes-for-the-wordpress-theme-repository/" target="_blank">http://www.chipbennett.net/2011/04/20/a-guide-to-reviewing-themes-for-the-wordpress-theme-repository/</a><br>
<br>
<br>
"No core WordPress functions introduced prior to one previous, major<br>
WordPress release are wrapped in function_exists() conditionals."<br>
<br>
Yet I miss this being mentioned in the theme review guidelines nor do I<br>
know whether wrapping functions is only *recommended* or even *required*.<br>
<br>
Could someone please explain how I should deal with it?<br>
<br>
Thank you, Bego (@pixolin)<br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</blockquote></div><br></div>