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

WordPress Trac noreply at wordpress.org
Wed Jul 28 16:48:37 UTC 2021


#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
---------------------------------------------+-----------------------------

Comment (by johnjamesjacoby):

 This broke bbPress, which relied pretty heavily on the previous behavior
 for topic and reply moderation.

 https://bbpress.trac.wordpress.org/ticket/3433

 The new `wp_untrash_post_status` filter did not help existing plugins
 maintain their status quo's.

 Why was there was no developer note for this breakage?

 In my opinion, the committed solution here is suboptimal. The
 `wp_untrash_post_set_previous_status()` implementation should have been
 the first clue this was not a great idea.

 A new property could have been added to `WP_Post_Type` to define the
 untrash status/behavior – core post types could have updated themselves
 (to default to `draft` per this issue) and the world of a thousand
 registered custom post types could migrate at their convenience, and no
 new single-use filter or function shim would have been necessary.

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


More information about the wp-trac mailing list