[theme-reviewers] Contributing to Codex

myazalea@hotmail.com myazalea at hotmail.com
Wed Aug 1 13:08:12 UTC 2012

Just a nudge/reminder that relates to the latest discussion;

Theme developers depend on the Codex being up to date.   If you have the knowledge to update or add to a section, please do. 
See Codex:Contributing.

----- Reply message -----
Från: "Chip Bennett" <chip at chipbennett.net>
Till: <theme-reviewers at lists.wordpress.org>
Rubrik: [theme-reviewers] Is wp_enqueue style/script necessary?
Datum: ons, aug 1, 2012 14:40
Yes. As stated explicitly in the Theme Review guidelines, 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. 

Also keep in mind: what is *required* for WPORG-hosted Themes is defined in the Theme Review guidelines. What is listed as "required" in the Theme Review guidelines 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.

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 Theme Review Guidelines:

Themes may optionally link the default stylesheet (style.css) directly in the document head, or via wp_enqueue_style().

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 Theme Review guidelines, the Theme Review Team does not have ultimate/final control over their development.

If you have any other questions, please check the Theme Review guidelines, or ask here on the mail-list.


On Wed, Aug 1, 2012 at 2:43 AM, CONNOR Wayne and Jill <wayne at dubbo.org> wrote:

I got this comment on last submission of my slidingdoor theme:
Themes are REQUIRED to enqueue all stylesheets and scripts, usingwp_enqueue_style()/wp_enqueue_script(), and hooked into an appropriate hook via callback function, rather than hard-coding stylesheet/script links or tags in the template.

I've been to http://codex.wordpress.org/Function_Reference/wp_enqueue_script 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!

Is it talking about my inclusion of say mootools in my header.php?

<script type="text/javascript" src="<?php echo $url; ?>/imagemenu/mootools.js"></script>
Do I need to do this differently?

It does say on the function reference page "The safe and recommended method of adding JavaScript to a WordPress generated page is by using wp_enqueue_script(). " 

'recommended' is not 'you must'.

I've checked out the twentyeleven theme and it has this in header:

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
that seems to be a direct including of a stylesheet not using wp_enque_style.

So some guidance would be appreciated.


theme-reviewers mailing list

theme-reviewers at lists.wordpress.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20120801/eff21b02/attachment-0001.htm>

More information about the theme-reviewers mailing list