Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#23772 closed enhancement (fixed)

Twenty Ten/Eleven: Use callback to enqueue scripts and styles

Reported by: obenland Owned by: lancewillett
Priority: normal Milestone: 3.6
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The theme review guidelines require themes to enqueue all stylesheets and scripts, using wp_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.

There might be a backwards compatibility issue when rogue scripts are hooked to 'wp_head' on 0 priority.

Attachments (2)

23772.diff (3.7 KB ) - added by obenland 13 years ago.
23772.1.diff (4.2 KB ) - added by obenland 13 years ago.

Download all attachments as: .zip

Change History (10)

@obenland
13 years ago

#1 @obenland
13 years ago

  • Component GeneralBundled Theme

#2 @lancewillett
13 years ago

  • Milestone Awaiting Review3.6

@obenland
13 years ago

#3 @lancewillett
13 years ago

In 23720:

Twenty Eleven: use callback in functions.php to enqueue scripts and styles rather than putting them directly in header.php template file. Props obenland, see #23772.

#4 @lancewillett
13 years ago

  • Owner set to lancewillett
  • Resolutionfixed
  • Status newclosed

In 23721:

Twenty Ten: use callback in functions.php to enqueue scripts and styles rather than putting them directly in header.php template file. Props obenland, fixes #23772.

#5 @lancewillett
13 years ago

Another case of bad news bears, like #23774.

This change isn't backward compatible with child themes, so we need to revert for both Ten and Eleven.

#6 @SergeyBiryukov
13 years ago

  • Resolution fixed
  • Status closedreopened

#7 @lancewillett
13 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 23778:

Twenty Ten and Twenty Eleven: revert r23720 and r23721 (closes #23772) and r23718 and r23719 (closes #23774).

Unfortunately, it's too late for these improvements in older themes since it's very likely they'll adversely affect child themes.

This ticket was mentioned in Slack in #themereview by kjell. View the logs.


7 years ago

Note: See TracTickets for help on using tickets.