WordPress.org

Make WordPress Core

#23774 closed defect (bug) (fixed)

Twenty Ten/Eleven: Use a filter to modify the output of wp_title()

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

Description

This will help to clean up header.php as well as make the first two Twenty themes more compatible with the WPTRT guidelines:

Themes are required to modify output via filter (wp_title/body_class/post_class)


See twentytwelve_wp_title() in Twenty Twelve for example code.

Attachments (1)

23774.diff (4.9 KB) - added by obenland 13 months ago.

Download all attachments as: .zip

Change History (6)

obenland13 months ago

comment:1 lancewillett13 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:2 lancewillett13 months ago

In 23718:

Twenty Eleven: use a filter to modify the output of wp_title(). Props obenland, see #23774.

comment:3 lancewillett13 months ago

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

In 23719:

Twenty Ten: use a filter to modify the output of wp_title(). Props obenland, closes #23774.

comment:4 lancewillett13 months ago

  • Keywords has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Bad news bears. :(

This change isn't backward compatible with child themes. If a child theme creates its own header.php template file, the title can be duplicated or worse.

We'll need to revert.

Twenty Twelve and onward should be fine since they shipped with the filter from the beginning.

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