[wp-trac] [WordPress Trac] #51643: Function capital_P_dangit is applied directly to document title

WordPress Trac noreply at wordpress.org
Sat Feb 27 01:34:54 UTC 2021


#51643: Function capital_P_dangit is applied directly to document title
----------------------------------------+-----------------------------
 Reporter:  dragunoff                   |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Formatting                  |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+-----------------------------
Changes (by jeremyfelt):

 * keywords:   => needs-patch good-first-bug
 * type:  defect (bug) => enhancement
 * milestone:  Awaiting Review => Future Release


Comment:

 It does seem odd that `wptexturize()`, `convert_chars()`, and
 `capital_P_dangit()` are all run on the title after the
 `document_title_parts` filter is applied in `wp_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 before `wp_document_title()` returns `$title`. We can then use
 the familiar pattern (`general-template.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 the
 `document_title` filter is applied.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51643#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list