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

WordPress Trac noreply at wordpress.org
Sat Aug 30 19:58:09 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
-------------------------------+-----------------------------

Comment (by siliconforks):

 Replying to [comment:1 SirLouen]:
 > How can you get `wp_insert_post` to return 0 with such limited logic?

 Isn't it easy to trigger this?

 {{{#!php
 <?php
 add_filter( 'wp_insert_post_empty_content', '__return_true' );
 }}}

 It looks like @tfrommen is simply proposing that the return value of
 `wp_insert_post()` be checked for errors?  That seems like it would be
 reasonable to me...

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


More information about the wp-trac mailing list