[wp-trac] [WordPress Trac] #23792: Disallow moving of locked posts to the trash
WordPress Trac
noreply at wordpress.org
Mon Mar 18 08:23:14 UTC 2013
#23792: Disallow moving of locked posts to the trash
--------------------------------------+--------------------
Reporter: azaozz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.6
Component: Administration | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch dev-feedback |
--------------------------------------+--------------------
Comment (by pdclark):
Replying to [comment:4 azaozz]:
> We should be checking the post lock before moving to the trash, i.e.
that code block needs to be above `if ( !wp_trash_post($post_id) )`. Also
not sure if we should exit when a post is locked, perhaps just skip it and
continue moving the rest to the trash.
[http://core.trac.wordpress.org/attachment/ticket/23792/23792-bulk-
edit.diff Patch updated] to display lock notice, and check *before*
trashing posts. ;)
Requests to trash a locked posts display
[http://core.trac.wordpress.org/attachment/ticket/23792/locked-not-
updated.png this notice], which already existed on
[https://github.com/WordPress/WordPress/blob/30ad180d6a3647d0a692fdae4c1ddb6e12ae6a60
/wp-admin/edit.php#L241 edit.php line 241].
Since
[https://github.com/search?q=%22wp_ajax_trash_post%22+repo%3Awordpress%2Fwordpress&type=Code&ref=searchresults
wp_ajax_posts()] is only called for Media
([http://core.trac.wordpress.org/browser/tags/3.5.1/wp-
includes/js/plupload/handlers.js#L139 plupload],
[http://core.trac.wordpress.org/browser/tags/3.5.1/wp-
includes/js/swfupload/handlers.js#L95 swfupload], which have no post locks
or trash, and it's backwards compatibility code that's not accessed from
anywhere, I assume it shouldn't be modified for this ticket? Is that
correct?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23792#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list