Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51643, comment 1


Ignore:
Timestamp:
02/27/2021 01:36:28 AM (4 years ago)
Author:
jeremyfelt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51643, comment 1

    initial v1  
    11It 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()`.
    22
    3 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.
     3I'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 (`default-filters.php`) to apply each of those in a way that can be unhooked.
    44
    55Because `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.