WP_Customize_Manager::check_changeset_lock_with_heartbeat( array $response, array $data, string $screen_id )

Check locked changeset with heartbeat API.


Description Description


Parameters Parameters

$response

(array) (Required) The Heartbeat response.

$data

(array) (Required) The $_POST data sent.

$screen_id

(string) (Required) The screen id.


Top ↑

Return Return

(array) The Heartbeat response.


Top ↑

Source Source

File: wp-includes/class-wp-customize-manager.php

	public function check_changeset_lock_with_heartbeat( $response, $data, $screen_id ) {
		if ( array_key_exists( 'check_changeset_lock', $data ) && 'customize' === $screen_id && current_user_can( 'customize' ) && $this->changeset_post_id() ) {
			$lock_user_id = wp_check_post_lock( $this->changeset_post_id() );

			if ( $lock_user_id ) {
				$response['customize_changeset_lock_user'] = $this->get_lock_user_data( $lock_user_id );
			} else {

				// Refreshing time will ensure that the user is sitting on customizer and has not closed the customizer tab.
				$this->refresh_changeset_lock( $this->changeset_post_id() );
			}
		}

		return $response;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.