WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#23772 closed enhancement (fixed)

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

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

Download all attachments as: .zip

Change History (9)

@obenland
4 years ago

#1 @obenland
4 years ago

  • Component changed from General to Bundled Theme

#2 @lancewillett
4 years ago

  • Milestone changed from Awaiting Review to 3.6

@obenland
4 years ago

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @lancewillett
4 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.

Note: See TracTickets for help on using tickets.