Opened 9 years ago
Closed 8 years ago
#31557 closed defect (bug) (invalid)
Blog details are misplaced in title tag with "left" separator location
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
This is a follow-up to #18548, and a regression introduced in WordPress 4.1 in r30074.
When calling wp_title()
with left
set as the separator location, blog details are appended without a separator, and the separator is in the wrong location.
<title> | Sample PageWordPress Develop</title>
See also #31078.
Attachments (3)
Change History (10)
#2
@
9 years ago
Another nit to pick with r30074. Why was a new filter introduced, but the new blog-details title parts are not sent through it? Now that it's in like this, anyone using the new filter still has to use the old filter to manipulate the blog-details that are appended at the end.
I see two filters to do 1 job, and neither are powerful or flexible enough to be universally useful without forcing plugins to fight for ownership in two places now instead of one before.
#4
follow-up:
↓ 5
@
9 years ago
- Keywords close added
Before we fix that bug, I think we should rather remove the wp_title()
dependency and take step 2 in the process for better document titles, #31078.
#5
in reply to:
↑ 4
@
9 years ago
Replying to obenland:
Before we fix that bug, I think we should rather remove the
wp_title()
dependency and take step 2 in the process for better document titles, #31078.
Maybe; except this is a clear bug and regression in functionality. I understand we are working towards a better title tag experience, but we have a responsibility to existing installations to repair what's broken also.
31557.01.patch touches a fair amount of code to fix this in a way that is backwards compatible with all core themes and popular plugins. The BuddyPress team has also done a fair amount of research into this over on BuddyPress #6107.
In short, the copy/pasted code from Underscores and the core themes derived from it did not take into account
left
separator location, since they have all always usedright
.On the feedback end of this all, the Underscores blog details portion should probably have been separated from the recent
title-tag
feature, maybe even on a different ticket to be explicit about the problem it solved. Combining those two changes made this more difficult to debug instead of easier.Also note the commit message does not mention that
wp_title()
now has a third output permutation supported by core themes, which required studying up on 4 years worth of discussion to comprehend what the intentions were, and how and why they were not fully met.Given the complexity and fragility of the
wp_title()
function, we may want to invest some time in writing a bevy of unit tests to ensure its output remains consistent through-out future modifications being thought through on #31078.