[wp-trac] [WordPress Trac] #30775: Delete empty post problem

WordPress Trac noreply at wordpress.org
Tue Mar 3 16:25:31 UTC 2015


#30775: Delete empty post problem
-------------------------------+------------------------------
 Reporter:  axdr               |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  3.3
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by tmoitie1):

 I've got this problem - Advanced Custom Fields is overriding this filter
 in order to post and has created a lot of untrashable posts:

 {{{
         /*
         *  wp_insert_post_empty_content
         *
         *  This function will allow WP to insert a new post without title
 / content if ACF data exists
         *
         *  @type        function
         *  @date        16/07/2014
         *  @since       5.0.1
         *
         *  @param       $maybe_empty (bool) whether the post should be
 considered "empty"
         *  @param       $postarr (array) Array of post data
         *  @return      $maybe_empty
         */

         function wp_insert_post_empty_content( $maybe_empty, $postarr ) {

                 if( $maybe_empty && !empty($_POST['_acfchanged']) ) {

                         $maybe_empty = false;

                 }


                 // return
                 return $maybe_empty;
         }
 }}}

 Whilst this example is probably a bug of ACF, I think that WordPress
 should be able to delete any posts independently of validation rules
 defining how they should be created or updated.

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


More information about the wp-trac mailing list