WordPress.org

Make WordPress Core

#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 13 months ago.
23772.1.diff (4.2 KB) - added by obenland 13 months ago.

Download all attachments as: .zip

Change History (9)

obenland13 months ago

comment:1 obenland13 months ago

  • Component changed from General to Bundled Theme

comment:2 lancewillett13 months ago

  • Milestone changed from Awaiting Review to 3.6

obenland13 months ago

comment:3 lancewillett13 months 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.

comment:4 lancewillett13 months 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.

comment:5 lancewillett13 months 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.

comment:6 SergeyBiryukov13 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 lancewillett13 months 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.