[wp-trac] [WordPress Trac] #51403: Add filter for _post_states as it outputs raw HTML

WordPress Trac noreply at wordpress.org
Tue Sep 30 11:42:14 UTC 2025


#51403: Add filter for _post_states as it outputs raw HTML
-------------------------------------------------+-------------------------
 Reporter:  brandbrilliance                      |       Owner:  SirLouen
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.9
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-test-info has-    |     Focuses:  template
  patch has-unit-tests                           |
-------------------------------------------------+-------------------------

Comment (by ugyensupport):

 == Add filter for _post_states as it outputs raw HTML
 === Description
 Currently this function can't be overridden with a filter, so it outputs
 raw HTML separators and such directly into the post title in the edit
 screen. However it should be suggested to make it possible to display the
 post states in your own custom function, e.g. remove the separators and
 the divider with the title, which are currently hard-coded at the moment
 in the function as raw HTML?

 Patch tested: https://github.com/WordPress/wordpress-develop/pull/10000

 === Environment
 - WordPress: 6.8.3-alpha-60773
 - PHP: 8.4.1
 - Server: nginx/1.21.4
 - Database: mysqli (Server: 5.7.44-log / Client: mysqlnd 8.4.1)
 - Browser: Chrome 140.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.3
 - MU Plugins: None activated
 - Plugins:
   * Gutenberg 21.7.0
   * Test Reports 1.2.0
   * WordPress Beta Tester 3.6.4


 === Expected Results
 1.  ✅ Issue resolved with patch.

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


More information about the wp-trac mailing list