Ticket #42658: 42658.diff
File 42658.diff, 1.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
8240 8240 // Check for lock when sending heartbeat requests. 8241 8241 $( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) { 8242 8242 data.check_changeset_lock = true; 8243 data.changeset_uuid = api.settings.changeset.uuid; 8243 8244 } ); 8244 8245 8245 8246 // Handle heartbeat ticks. -
src/wp-includes/class-wp-customize-manager.php
3163 3163 * @return array The Heartbeat response. 3164 3164 */ 3165 3165 public function check_changeset_lock_with_heartbeat( $response, $data, $screen_id ) { 3166 if ( array_key_exists( 'check_changeset_lock', $data ) && 'customize' === $screen_id && current_user_can( 'customize' ) && $this->changeset_post_id() ) { 3167 $lock_user_id = wp_check_post_lock( $this->changeset_post_id() ); 3166 if ( isset( $data['changeset_uuid'] ) ) { 3167 $changeset_post_id = $this->find_changeset_post_id( $data['changeset_uuid'] ); 3168 } else { 3169 $changeset_post_id = $this->changeset_post_id(); 3170 } 3168 3171 3172 if ( array_key_exists( 'check_changeset_lock', $data ) && 'customize' === $screen_id && current_user_can( 'customize' ) && $changeset_post_id ) { 3173 $lock_user_id = wp_check_post_lock( $changeset_post_id ); 3174 3169 3175 if ( $lock_user_id ) { 3170 3176 $response['customize_changeset_lock_user'] = $this->get_lock_user_data( $lock_user_id ); 3171 3177 } else { 3172 3178 3173 3179 // Refreshing time will ensure that the user is sitting on customizer and has not closed the customizer tab. 3174 $this->refresh_changeset_lock( $ this->changeset_post_id());3180 $this->refresh_changeset_lock( $changeset_post_id ); 3175 3181 } 3176 3182 } 3177 3183