[wp-trac] [WordPress Trac] #24572: Should be able to unlock a post outside of ajax handler
WordPress Trac
noreply at wordpress.org
Wed Jun 12 20:28:38 UTC 2013
#24572: Should be able to unlock a post outside of ajax handler
----------------------------+-----------------------------
Reporter: bbrooks | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Keywords: has-patch
----------------------------+-----------------------------
Right now you can programmatically lock a post for editing using
wp_set_post_lock, but you can't unlock it in a similar fashion. The only
unlocking code is found in the ajax handler wp_ajax_wp_remove_post_lock.
I've created a function wp_unset_post_lock in the style of
wp_set_post_lock that unlocks a post with a given ID. I've also refactored
wp_ajax_wp_remove_post_lock to use this function.
The only resulting difference is that we use the current user's ID instead
of the one supplied in the ajax call, but since we're unlocking the post
instead of locking it, it doesn't really matter who's ID is in the meta.
This change was requested by Joey Kudish of the VIP team.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24572>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list