wppaste
WordPress

WP_Customize_Manager::handle_override_changeset_lock_request()

Since
4.9.0
Source
wp-includes/class-wp-customize-manager.php:3391
Removes changeset lock when take over request is sent via Ajax.

Uses · 9

Source

	public function handle_override_changeset_lock_request() {		if ( ! $this->is_preview() ) {			wp_send_json_error( 'not_preview', 400 );		} 		if ( ! check_ajax_referer( 'customize_override_changeset_lock', 'nonce', false ) ) {			wp_send_json_error(				array(					'code'    => 'invalid_nonce',					'message' => __( 'Security check failed.' ),				)			);		} 		$changeset_post_id = $this->changeset_post_id(); 		if ( empty( $changeset_post_id ) ) {			wp_send_json_error(				array(					'code'    => 'no_changeset_found_to_take_over',					'message' => __( 'No changeset found to take over' ),				)			);		} 		if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post_id ) ) {			wp_send_json_error(				array(					'code'    => 'cannot_remove_changeset_lock',					'message' => __( 'Sorry, you are not allowed to take over.' ),				)			);		} 		$this->set_changeset_lock( $changeset_post_id, true ); 		wp_send_json_success( 'changeset_taken_over' );	}

History

Introduced in 4.9.0. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.1.0
Return type changed from none to never.verified against source
4.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/class-wp-customize-manager.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.