[wp-trac] [WordPress Trac] #23022: Always set posts to draft status when untrashing

WordPress Trac noreply at wordpress.org
Sat Aug 19 18:43:09 UTC 2017


#23022: Always set posts to draft status when untrashing
-------------------------------------------------+-------------------------
 Reporter:  harrym                               |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Posts, Post Types                    |  Release
 Severity:  normal                               |     Version:  2.9
 Keywords:  editorial-flow good-first-bug has-   |  Resolution:
  patch                                          |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------

Comment (by jaredcobb):

 Note: In order to keep the previous behavior (where a restored post
 receives the `post_status` it had before it was trashed) use the
 `wp_untrash_post_status` filter like so:

 {{{#!php
 <?php
 add_filter( 'wp_untrash_post_status', function( $new_status, $post_id,
 $previous_status ) {
         return $previous_status;
 }, 10, 3 );
 }}}

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


More information about the wp-trac mailing list