Thanks! We appreciate the nudge, and do try to push any needed Codex changes "upstream", so to speak. However, in this case, I don't think the Codex entry for wp_enqueue_script() is incorrect.<div><br></div><div>
Chip<br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 8:08 AM, <a href="mailto:myazalea@hotmail.com">myazalea@hotmail.com</a> <span dir="ltr"><<a href="mailto:myazalea@hotmail.com" target="_blank">myazalea@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just a nudge/reminder that relates to the latest discussion;<br><br>Theme developers depend on the Codex being up to date. If you have the knowledge to update or add to a section, please do. <br>
See Codex:Contributing.<br><a href="http://codex.wordpress.org/Codex:Contributing" target="_blank">http://codex.wordpress.org/Codex:Contributing</a><br><br><div>----- Reply message -----<br>Från: "Chip Bennett" <<a href="mailto:chip@chipbennett.net" target="_blank">chip@chipbennett.net</a>><br>
Till: <<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a>><br>Rubrik: [theme-reviewers] Is wp_enqueue style/script necessary?<br>Datum: ons, aug 1, 2012 14:40<br>
<br></div><br>Yes. As stated explicitly in the <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review guidelines</a>, this is absolutely required, for a few reasons. First, using wp_enqueue_script() ensures that the script is output correctly in relation to other scripts being output. It also ensures that any dependencies are met, and that any core-bundled scripts are used. Also, using a callback allows for a Plugin or Child Theme to dequeue/override a given script. <div>
<br></div><div>Also keep in mind: what is *required* for WPORG-hosted Themes is defined in the <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review guidelines</a>. What is listed as "required" in the <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review guidelines</a> supersedes anything else you might find elsewhere in the Codex. The reason that enqueueing scripts is *required* for WPORG-hosted Themes is *because* this method is the safe, recommended, and best-practice method for including scripts in Themes.</div>
<div><br></div><div>The only exception to this rule is the default stylesheet, which can be hard-coded in the document head or enqueued (but in either case, must be called using get_stylesheet_uri()), as stated explicitly in the <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review Guidelines</a>:</div>
<div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><span style="line-height:22px;text-align:left;font-size:13px;font-family:sans-serif">Themes may </span><b style="line-height:22px;text-align:left;font-size:13px;font-family:sans-serif">optionally</b><span style="line-height:22px;text-align:left;font-size:13px;font-family:sans-serif"> link the default stylesheet (</span><tt style="line-height:22px;text-align:left;font-size:13px">style.css</tt><span style="line-height:22px;text-align:left;font-size:13px;font-family:sans-serif">) directly in the document head, or via </span><tt style="line-height:22px;text-align:left;font-size:13px">wp_enqueue_style()</tt><span style="line-height:22px;text-align:left;font-size:13px;font-family:sans-serif">.</span></div>
</blockquote></div><div><br></div><div>Also, "but Twenty Eleven does it!" is never considered a valid argument. While we do our best to contribute back into core-bundled Themes to ensure that they always meet current <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review guidelines</a>, the Theme Review Team does not have ultimate/final control over their development.</div>
<div><br></div><div>If you have any other questions, please check the <a href="http://codex.wordpress.org/Theme_Review" target="_blank">Theme Review guidelines</a>, or ask here on the mail-list.</div><div><br></div><div>
Thanks,</div><div>
<br></div><div>Chip<br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 2:43 AM, CONNOR Wayne and Jill <span dir="ltr"><<a href="mailto:wayne@dubbo.org" target="_blank">wayne@dubbo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">I got this comment on last submission of my slidingdoor theme:<div><br></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;word-spacing:0px">Themes are REQUIRED to enqueue all stylesheets and scripts, using</span><tt style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;word-spacing:0px">wp_enqueue_style()</tt><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;word-spacing:0px">/</span><tt style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;word-spacing:0px">wp_enqueue_script()</tt><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;word-spacing:0px">, and hooked into an appropriate hook via callback function, rather than hard-coding stylesheet/script links or tags in the template.</span></div>
<div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br>
</span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px">I've been to <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script" target="_blank">http://codex.wordpress.org/Function_Reference/wp_enqueue_script</a> and I don't actually understand what it's saying. I don't want to get my head around it if I don't have to!</span></font></div>
<div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br>
</span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px">Is it talking about my inclusion of say mootools in my header.php?</span></font></div>
<div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><div>
<script type="text/javascript" src="<?php echo $url; ?>/imagemenu/mootools.js"></script></div><div><br></div></span></font></div><div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px">Do I need to do this differently?</span></font></div>
</div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br>
</span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br>
</span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px">It does say on the function reference page "</span></font><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:22px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px">The safe and recommended method of adding JavaScript to a WordPress generated page is by using </span><code style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;margin-bottom:22px;font-weight:normal;overflow-x:auto;line-height:22px;text-transform:none;font-size:12px;white-space:pre-wrap;font-family:Consolas,Monaco,'Courier New',Courier,monospace;word-wrap:break-word;word-spacing:0px">wp_enqueue_script()</code><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:22px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px">. " </span></div>
<div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:22px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px"><br>
</span></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:22px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px">'recommended' is not 'you must'.</span></div>
<div style="text-align:left"><font face="sans-serif"><span style="font-size:13px;line-height:22px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px">I've checked out the twentyeleven theme and it has this in header:</span></font></div>
<div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><br></span></font></div><div><font face="Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif"><span style="font-size:13px"><div>
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /></div><div><br></div><div>that seems to be a direct including of a stylesheet not using wp_enque_style.</div>
<div><br></div><div>So some guidance would be appreciated.</div><div><br></div><div>Thanks,</div><div>Wayne</div><div><br></div></span></font><div><br></div><div><br></div></div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">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>
<br></blockquote></div><br></div>
<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>
<br></blockquote></div><br></div>