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

WordPress Trac noreply at wordpress.org
Sat Aug 30 19:28:32 UTC 2025


#37441: get_default_post_to_edit() function is broken
-------------------------------+-----------------------------
 Reporter:  tfrommen           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  worksforme
 Keywords:                     |     Focuses:  administration
-------------------------------+-----------------------------
Changes (by SirLouen):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 I don't really get the problem.

 How can you get `wp_insert_post` to return 0 with such limited logic?

 The only parameter that can be affected is `$post_type` setting a wrong or
 unexistant post_type, in which case, even using a non-existent or invalid
 `post_type` it will never return 0.

 > The problem is, there are se-ve-ral rea-sons under which
 wp_insert_post() returns 0

 So despite providing a whole bunch of examples where `wp_insert_post` this
 is not particularly affecting this code section.

 I'm closing this because its not reproducible under the conditions
 provided (code-wise). Obviously if we alter the code to fit this, it will
 be reproducible, but this misses the whole point.

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


More information about the wp-trac mailing list