[wp-trac] [WordPress Trac] #17115: Publishing an empty post results in success

WordPress Trac noreply at wordpress.org
Wed Aug 14 16:32:10 UTC 2013


#17115: Publishing an empty post results in success
----------------------------+------------------------------
 Reporter:  kawauso         |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.1
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------------------
Changes (by ericmann):

 * keywords:  needs-patch => has-patch


Comment:

 Ported a patch for this ticket, based on the existing work on #11082.
 Basically, check to see if the status of the "saved" post is still auto-
 draft.  If so, it means things didn't save to the database and we should
 notify the author of that fact.

 Just to clarify, there is a safeguard in core against adding posts with
 empty content.  If the title, content, and excerpt are all empty, and the
 theme supports title, content, and excerpt for the post type, then
 `wp_insert_post()` will bail out early and nothing will be saved - this
 also means the `save_post` hook will not run.  This functionality can be
 disabled with a hook:

 {{{
 add_filter( 'wp_insert_post_empty_content', '__return_false' );
 }}}

 See ~line 2670 of /wp-includes/post.php for details on the hook and what
 it's testing against.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/17115#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list