[wp-trac] [WordPress Trac] #24830: No notifications should be shown when filter 'show_post_locked_dialog' returns false

WordPress Trac noreply at wordpress.org
Fri Jul 26 16:53:31 UTC 2013


#24830: No notifications should be shown when filter 'show_post_locked_dialog'
returns false
--------------------------+--------------------
 Reporter:  DH-Shredder   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.6
Component:  Autosave      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by azaozz):

 Perhaps it would be better to remove this filter completely. Plugins have
 several other options to manage post locking, including adding a "Close"
 button to the dialog, changing it from a modal to a standard warning
 (above the title field), etc.

 To stop showing post locked dialogs completely, it is better to remove the
 html for the modal. Then locks won't be checked with heartbeat too.
 Example:
 {{{
 add_action( 'admin_footer', 'my_disable_post_locks', 1 );
 function my_disable_post_locks() {
         remove_action( 'admin_footer', '_admin_notice_post_locked' );
 }
 }}}

 Alternatively the filter can be moved to wp_refresh_post_lock(). Then a
 plugin can decide whether to show the "Post taken over" part of the
 dialog, i.e. if a user will be "booted" when another user/superadmin takes
 over the lock. This can also be done by hooking into the existing
 `'heartbeat_send'` filter and removing the `wp-refresh-post-lock` array
 key from the response, but it will be running after we generate that
 response.

 A better improvement would be to have separate actions for adding text to
 either the "Post is currently locked" or "Post lock taken over" parts of
 the dialog. Currently there is one action `'post_lock_text'` fired in
 both.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24830#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list