WP_Customize_Manager::changeset_data() WordPress Method

The WP_Customize_Manager::changeset_data() method is used to get the data for a changeset. This data includes the changeset title, the UUID for the changeset, the data for each changed setting, and the status of the changeset.

WP_Customize_Manager::changeset_data() #

Gets changeset data.


Return

(array) Changeset data.


Top ↑

Source

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

	public function changeset_data() {
		if ( isset( $this->_changeset_data ) ) {
			return $this->_changeset_data;
		}
		$changeset_post_id = $this->changeset_post_id();
		if ( ! $changeset_post_id ) {
			$this->_changeset_data = array();
		} else {
			if ( $this->autosaved() && is_user_logged_in() ) {
				$autosave_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() );
				if ( $autosave_post ) {
					$data = $this->get_changeset_post_data( $autosave_post->ID );
					if ( ! is_wp_error( $data ) ) {
						$this->_changeset_data = $data;
					}
				}
			}

			// Load data from the changeset if it was not loaded from an autosave.
			if ( ! isset( $this->_changeset_data ) ) {
				$data = $this->get_changeset_post_data( $changeset_post_id );
				if ( ! is_wp_error( $data ) ) {
					$this->_changeset_data = $data;
				} else {
					$this->_changeset_data = array();
				}
			}
		}
		return $this->_changeset_data;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0This will return the changeset's data with a user's autosave revision merged on top, if one exists and $autosaved is true.
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More