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

WordPress Trac noreply at wordpress.org
Fri Feb 3 17:07:15 UTC 2017


#17115: Publishing an empty post results in success
------------------------------------+------------------------------
 Reporter:  kawauso                 |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Posts, Post Types       |     Version:  3.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  administration
------------------------------------+------------------------------

Comment (by adamsilverstein):

 [attachment:17115.7.diff] is a rollup of previous patches

 * When users publish a post with empty title/content/excerpt they get an
 error message saying they need to add content.
 * Saving post drafts with empty fields works fine and these still can't be
 published.
 * Respects the `wp_insert_post_empty_content` filter.

 Screenshots
 ----

 Publish a post with blank content fields: shows an error message, post is
 not saved:

 [[Image(https://cl.ly/1L1w0Y272v37/Screen%20Recording%202017-02-03%20at%2011.21%20AM.gif)]]

 ----
 Save a draft with blank content fields: success, draft is saved. Post
 still can't be published:

 [[Image(https://cl.ly/1m0K09181v02/Screen%20Recording%202017-02-03%20at%2011.51%20AM.gif)]]

 ----
 Adding the filter to enable publishing of blank posts works as expected.
 `add_filter( 'wp_insert_post_empty_content', '__return_false' );`

 [[Image(https://cl.ly/3S2v1v3o0p38/Screen%20Recording%202017-02-03%20at%2011.54%20AM.gif)]]

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


More information about the wp-trac mailing list