Make WordPress Core

Ticket #42658: 42658.diff

File 42658.diff, 1.9 KB (added by dlh, 8 years ago)
  • src/wp-admin/js/customize-controls.js

     
    82408240                        // Check for lock when sending heartbeat requests.
    82418241                        $( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) {
    82428242                                data.check_changeset_lock = true;
     8243                                data.changeset_uuid = api.settings.changeset.uuid;
    82438244                        } );
    82448245
    82458246                        // Handle heartbeat ticks.
  • src/wp-includes/class-wp-customize-manager.php

     
    31633163         * @return array The Heartbeat response.
    31643164         */
    31653165        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                }
    31683171
     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
    31693175                        if ( $lock_user_id ) {
    31703176                                $response['customize_changeset_lock_user'] = $this->get_lock_user_data( $lock_user_id );
    31713177                        } else {
    31723178
    31733179                                // 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 );
    31753181                        }
    31763182                }
    31773183