WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#7114 closed enhancement (wontfix)

do not add whitespace to sep in wp_title()

Reported by: mm6 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

wp_title() includes spaces in some places where I don't want them and leaves out spaces in some places where I do want them. This patch changes wp_title() to use exactly what is passed in for a sep without adding any whitespace to it. This gives the caller better control over the separator.

Example of too much whitespace:

<title>mmb &raquo; Blog Archive &raquo; python twitter client / module</title>

Example of not enough whitespace:

<title>mmb &raquo; 2008&raquo; June</title>

Attachments (1)

wp_title_sep.patch (1.5 KB) - added by mm6 6 years ago.
do not add whitespace to sep in wp_title()

Download all attachments as: .zip

Change History (4)

mm66 years ago

do not add whitespace to sep in wp_title()

comment:1 mm66 years ago

Test with default theme and WordPress 2.5.1:

Pre patch:

<title>test </title>

<title>test &raquo; 2008&raquo; June</title>

<title>test &raquo; Uncategorized</title>

<title>test &raquo; Blog Archive &raquo; Hello world!</title>

Post patch (remaining extra spaces can be fixed in theme):

<title>test </title>

<title>test &raquo; 2008 &raquo; June</title>

<title>test &raquo; Uncategorized</title>

<title>test &raquo; Blog Archive &raquo; Hello world!</title>

Example of separator without any whitespace:

<title>test </title>

<title>test XXX2008XXXJune</title>

<title>test XXXUncategorized</title>

<title>test &raquo; Blog Archive XXXHello world!</title>

comment:2 ryan6 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Many themes rely on this behavior though. We'd have to change in a back compat way.

comment:3 jacobsantos5 years ago

  • Milestone 2.7 deleted
Note: See TracTickets for help on using tickets.