diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5afcd783bd..785fc7f895 100644
|
|
|
8208 | 8208 | // Check for lock when sending heartbeat requests. |
8209 | 8209 | $( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) { |
8210 | 8210 | data.check_changeset_lock = true; |
| 8211 | data.changeset_uuid = api.settings.changeset.uuid; |
8211 | 8212 | } ); |
8212 | 8213 | |
8213 | 8214 | // Handle heartbeat ticks. |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index bc215fef56..2cddb70370 100644
|
|
final class WP_Customize_Manager { |
3204 | 3204 | * @return array The Heartbeat response. |
3205 | 3205 | */ |
3206 | 3206 | public function check_changeset_lock_with_heartbeat( $response, $data, $screen_id ) { |
3207 | | if ( array_key_exists( 'check_changeset_lock', $data ) && 'customize' === $screen_id && current_user_can( 'customize' ) && $this->changeset_post_id() ) { |
3208 | | $lock_user_id = wp_check_post_lock( $this->changeset_post_id() ); |
| 3207 | if ( isset( $data['changeset_uuid'] ) ) { |
| 3208 | $changeset_post_id = $this->find_changeset_post_id( $data['changeset_uuid'] ); |
| 3209 | } else { |
| 3210 | $changeset_post_id = $this->changeset_post_id(); |
| 3211 | } |
| 3212 | |
| 3213 | if ( |
| 3214 | array_key_exists( 'check_changeset_lock', $data ) |
| 3215 | && 'customize' === $screen_id |
| 3216 | && $changeset_post_id |
| 3217 | && current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) |
| 3218 | ) { |
| 3219 | $lock_user_id = wp_check_post_lock( $changeset_post_id ); |
3209 | 3220 | |
3210 | 3221 | if ( $lock_user_id ) { |
3211 | 3222 | $response['customize_changeset_lock_user'] = $this->get_lock_user_data( $lock_user_id ); |
3212 | 3223 | } else { |
3213 | 3224 | |
3214 | 3225 | // Refreshing time will ensure that the user is sitting on customizer and has not closed the customizer tab. |
3215 | | $this->refresh_changeset_lock( $this->changeset_post_id() ); |
| 3226 | $this->refresh_changeset_lock( $changeset_post_id ); |
3216 | 3227 | } |
3217 | 3228 | } |
3218 | 3229 | |