HTTP/2 301
server: nginx
date: Fri, 25 Jul 2025 12:24:52 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/classes/WP_Customize_Manager/changeset_data/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Fri, 25 Jul 2025 12:24:52 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
WP_Customize_Manager::changeset_data() – Method | Developer.WordPress.org
WordPress Developer Resources
WP_Customize_Manager::changeset_data()
WP_Customize_Manager::changeset_data(): array
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;
}
View all references View on Trac View on GitHub
Version | Description |
---|
4.9.0 | This will return the changeset’s data with a user’s autosave revision merged on top, if one exists and $autosaved is true. |
4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.