[theme-reviewers] Is after_setup_theme required?

carolina poena myazalea at hotmail.com
Fri May 16 02:39:51 UTC 2014


Would this be allowed:
 
function name(){
 add_theme_support( 'automatic-feed-links' );
 if ( ! isset( $content_width ) ) $content_width = 900;
}
name();

add_action('init', 'name2');
function name2() {
 register_nav_menus( array('header' => __( 'Header Navigation', 'theme-slug' ) ) ); 
}
 
Or do I require the author to add a new function and use it with after_setup_theme.

 
Date: Thu, 15 May 2014 23:40:47 +0200
From: myazalea at hotmail.com
To: theme-reviewers at lists.wordpress.org
Subject: Re: [theme-reviewers] Is after_setup_theme required?






But what is the correct hook is not that well documented. If you look at the codex for register_nav_menu it doesn't mention any hooks, and for add_theme_support it sais "if" attached to a hook. 
It seems more like advice than requirement.
I'll try to be more specific, but right now it's just too late ;)







Skickat från min Samsung Mobil





-------- Originalmeddelande --------
Från: Justin Tadlock 
Datum:15-05-2014 20:12 (GMT+01:00) 
Till: "Discussion list for WordPress theme reviewers." 

Rubrik: Re: [theme-reviewers] Is after_setup_theme required? 




What's required is that themes appropriately execute their code on the correct hook rather than arbitrarily executing it in `functions.php`. If something should be done on the `after_setup_theme` hook, the theme author should create a function
 and execute his or her code on that hook.




On Thu, May 15, 2014 at 1:00 PM, Ulrich Pogson 
<grapplerulrich at gmail.com> wrote:


The way I understand it, the reason you use `after_setup_theme` is so that the code is run only when needed for the theme. If it is not mentioned in the guidelines then I would it is highly recommended.





On 15 May 2014 18:41, carolina poena <myazalea at hotmail.com> wrote:





Is using after_setup_theme required when adding register_nav_menu, add_theme_support, load_theme_textdomain etc,

or is using init allowed?

 






_______________________________________________

theme-reviewers mailing list

theme-reviewers at lists.wordpress.org

http://lists.wordpress.org/mailman/listinfo/theme-reviewers










_______________________________________________

theme-reviewers mailing list

theme-reviewers at lists.wordpress.org

http://lists.wordpress.org/mailman/listinfo/theme-reviewers












_______________________________________________
theme-reviewers mailing list
theme-reviewers at lists.wordpress.org
http://lists.wordpress.org/mailman/listinfo/theme-reviewers
_______________________________________________
theme-reviewers mailing list
theme-reviewers at lists.wordpress.org
http://lists.wordpress.org/mailman/listinfo/theme-reviewers 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140516/0e586099/attachment.html>


More information about the theme-reviewers mailing list