[wp-trac] [WordPress Trac] #44900: add post lock display to Media Library

WordPress Trac noreply at wordpress.org
Wed Sep 5 16:53:06 UTC 2018


#44900: add post lock display to Media Library
-------------------------+-------------------------------------------------
 Reporter:  pbiron       |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:
 Severity:  normal       |   Keywords:  needs-design has-patch has-
  Focuses:  ui,          |  screenshots
  administration         |
-------------------------+-------------------------------------------------
 `WP_Posts_List_Table` shows which posts are currently being edited by
 other users (screenshot coming).

 `WP_Media_List_Table` should do so as well (screenshot coming).

 Much of the support for post locks on media already exists in core:

 1. when media is edited (in list mode, see below for discussion on grid
 mode), core already correctly updates the `_edit_lock` and `_edit_last`
 postmetas for the attachment
 1. both ends of the "Take Over" modal dialog already function as expected
 when editing media (screenshots coming)

 To support post locks for media several other things need to happen:

 1. add the appropriate markup to the output of `WP_Media_List_Table` (in
 list mode, see below for discussion on grid mode)
 1. `/wp-admin/upload.php` needs to enqueue:
     1. the Heartbeat API
     1. JS that uses the Heartbeat API to update the post lock display

 A patch that does the above is coming shortly.

 As hinted at above, handling post locks in grid mode will require more
 work:

 1. design work will be needed for how to display the fact that there is a
 post lock in grid mode (screenshot coming)
     1. once that design work is done then code (probably JS) will need to
 be written to implement the design
 1. several changes will be needed to the "Attachment Details" screen that
 comes up when an attachment is clicked on from grid mode:
     1. the `_edit_lock` and `_edit_last` postmetas will need to be updated
 when the user enters this screen
     1. some JS based on the Heartbeat API will need to check for newly
 acquired post locks and fire the "Take Over" modal dialog
     1. I think the previous item will take care of things when the user
 clicks on the "Edit Image" button from the "Attachment Details" screen,
 but that remains to be seen
     1. Note: when a user clicks on the "Edit more details" link the
 existing core functionality and the changes to list mode above take over
 and no more changes are needed to handle that

 I'm unfamiliar with the JS-side of grid mode so at this point can't
 provide a patch for those changes, but would gladly help someone else work
 on that (if only so I can learn that JS piece).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44900>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list