Opened 4 months ago
Last modified 9 days ago
#51643 new enhancement
Function capital_P_dangit is applied directly to document title
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Formatting | Keywords: | needs-patch good-first-bug |
Focuses: | Cc: |
Description
This formatting function is normally applied via filters. But in wp_get_document_title
it's called directly and thus its effect is forced onto the user. It should instead be hooked to the filter document_title_parts
.
Change History (1)
Note: See
TracTickets for help on using
tickets.
It does seem odd that
wptexturize()
,convert_chars()
, andcapital_P_dangit()
are all run on the title after thedocument_title_parts
filter is applied inwp_document_title()
.I'm not sure if we can adjust the order now that it's been there for a few years, but it looks like there's room for a
document_title
filter that is applied beforewp_document_title()
returns$title
. We can then use the familiar pattern (default-filters.php
) to apply each of those in a way that can be unhooked.Because
wp_document_title()
is expected to return a string safe for use in<title></title>
,esc_html()
should probably be run after thedocument_title
filter is applied.