[wp-trac] [WordPress Trac] #37441: get_default_post_to_edit() function is broken

WordPress Trac noreply at wordpress.org
Sat Aug 30 23:09:29 UTC 2025


#37441: get_default_post_to_edit() function is broken
-------------------------------------------------+-------------------------
 Reporter:  tfrommen                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Posts, Post Types                    |     Version:  5.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-test-info needs-patch good-      |     Focuses:
  first-bug                                      |  administration
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:   => has-test-info needs-patch good-first-bug
 * status:  closed => reopened
 * version:   => 5.6
 * resolution:  worksforme =>
 * milestone:   => Future Release


Comment:

 == Reproduction Report
 === Description
 ✅ This report validates that the issue can be reproduced.

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.29
 - Server: nginx/1.29.1
 - Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
 - Browser: Chrome 140.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.3
 - MU Plugins: None activated
 - Plugins:
   * Testing Dolly 1.0.0
   * Test Reports 1.2.0

 === Testing Instructions
 1. Add the filter [https://core.trac.wordpress.org/ticket/37441#comment:2
 as shown in this comment]
 2. Create a new Post
 3. 🐞 Bug will be triggered

 === Actual Results
 1.  ✅ Error condition occurs (reproduced).

 === Additional Notes
 - Thanks @siliconforks for spotting this. I thought that `wp_error` was
 `true` by default so basically I was checking all the hooks, thinking they
 should trigger `WP_Error` in my mind.

 - Checking the historic changes it seems that this `false` was introduced
 in [49172], #45114 by @peterwilsoncc. I can't see any specific reasoning
 behind this logic for this specific setting (nor for `fire_after_hooks`
 which was also later reverted in [49731]

 - So I can also concludes, as @siliconforks suggests, that this might be
 as simple as calling `wp_insert_post` with `wp_error` set to `true` in
 `get_default_post_to_edit`.

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


More information about the wp-trac mailing list