Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 5 years ago

#23772 closed enhancement (fixed)

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

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

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 12 years ago.
23772.1.diff (4.2 KB) - added by obenland 12 years ago.

Download all attachments as: .zip

Change History (10)

@obenland
12 years ago

#1 @obenland
12 years ago

  • Component changed from General to Bundled Theme

#2 @lancewillett
12 years ago

  • Milestone changed from Awaiting Review to 3.6

@obenland
12 years ago

#3 @lancewillett
12 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
12 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

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
12 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
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @lancewillett
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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.


5 years ago

Note: See TracTickets for help on using tickets.