WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/30/2018 03:23:39 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Customize: Ensure heartbeat keeps changeset locked when in branching mode.

Props dlh.
See #42024.
Merges [42612] to the 4.9 branch.
Fixes #42658.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/class-wp-customize-manager.php

    r42620 r42623  
    31713171     */
    31723172    public function check_changeset_lock_with_heartbeat( $response, $data, $screen_id ) {
    3173         if ( array_key_exists( 'check_changeset_lock', $data ) && 'customize' === $screen_id && current_user_can( 'customize' ) && $this->changeset_post_id() ) {
    3174             $lock_user_id = wp_check_post_lock( $this->changeset_post_id() );
     3173        if ( isset( $data['changeset_uuid'] ) ) {
     3174            $changeset_post_id = $this->find_changeset_post_id( $data['changeset_uuid'] );
     3175        } else {
     3176            $changeset_post_id = $this->changeset_post_id();
     3177        }
     3178
     3179        if (
     3180            array_key_exists( 'check_changeset_lock', $data )
     3181            && 'customize' === $screen_id
     3182            && $changeset_post_id
     3183            && current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id )
     3184        ) {
     3185            $lock_user_id = wp_check_post_lock( $changeset_post_id );
    31753186
    31763187            if ( $lock_user_id ) {
     
    31793190
    31803191                // Refreshing time will ensure that the user is sitting on customizer and has not closed the customizer tab.
    3181                 $this->refresh_changeset_lock( $this->changeset_post_id() );
     3192                $this->refresh_changeset_lock( $changeset_post_id );
    31823193            }
    31833194        }
Note: See TracChangeset for help on using the changeset viewer.