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

WordPress Trac noreply at wordpress.org
Sun Oct 11 13:37:20 UTC 2020


#23022: Always set posts to draft status when untrashing
---------------------------------------------+-----------------------------
 Reporter:  harrym                           |       Owner:  johnbillion
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  5.6
Component:  Posts, Post Types                |     Version:  2.9
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  administration
---------------------------------------------+-----------------------------
Changes (by johnbillion):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49125" 49125]:
 {{{
 #!CommitTicketReference repository="" revision="49125"
 Posts, Post Types: Switch to restoring posts to `draft` status by default
 when they are untrashed.

 This allows for edits to be made to a restored post before it goes live
 again. This also prevents scheduled posts being published unexpectedly if
 they are untrashed after their originally scheduled date.

 The old behaviour of restoring untrashed posts to their original status
 can be reinstated using the `wp_untrash_post_set_previous_status()` helper
 function.

 Also fixes an issue where the incorrect post ID gets passed to hooks if no
 post ID is passed to the function.

 Props harrym, bananastalktome, jaredcobb, chriscct7, melchoyce,
 johnbillion, pankajmohale

 Fixes #23022
 }}}

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


More information about the wp-trac mailing list