wppaste
WordPress

apply_filters( 'customize_changeset_save_data', array $data, array $context )

Since
4.7.0
Filters the settings' data that will be persisted into the changeset.

Description

Plugins may amend additional data (such as additional meta for settings) into the changeset with this filter.

Compatibility

WordPress
since 4.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$dataarray
Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata.
$contextarray
{ Filter context.
@type string $uuid Changeset UUID.
@type string $title Requested title for the changeset post.
@type string $status Requested status for the changeset post.
@type string $date_gmt Requested date for the changeset post in MySQL format and GMT timezone.
@type int|false $post_id Post ID for the changeset, or false if it doesn't exist yet.
@type array $previous_data Previous data contained in the changeset.
@type WP_Customize_Manager $manager Manager instance.
}
  • $uuidstring

    Changeset UUID.
  • $titlestring

    Requested title for the changeset post.
  • $statusstring

    Requested status for the changeset post.
  • $date_gmtstring

    Requested date for the changeset post in MySQL format and GMT timezone.
  • $post_idint|false

    Post ID for the changeset, or false if it doesn't exist yet.
  • $previous_dataarray

    Previous data contained in the changeset.
  • $managerWP_Customize_Manager

    Manager instance.

Where this hook fires · 1

  • wp-includes/class-wp-customize-manager.php:2904WP_Customize_Manager::save_changeset_post()

Source code

<?php		 *     @type string               $date_gmt      Requested date for the changeset post in MySQL format and GMT timezone.		 *     @type int|false            $post_id       Post ID for the changeset, or false if it doesn't exist yet.		 *     @type array                $previous_data Previous data contained in the changeset.		 *     @type WP_Customize_Manager $manager       Manager instance.		 * }		 */		$data = apply_filters( 'customize_changeset_save_data', $data, $filter_context ); 		// Switch theme if publishing changes now.		if ( 'publish' === $args['status'] && ! $this->is_theme_active() ) {			// Temporarily stop previewing the theme to allow switch_themes() to operate properly.			$this->stop_previewing_theme();			switch_theme( $this->get_stylesheet() );

Changelog

Introduced in 4.7.0. Unchanged from 6.7.7 through 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.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, 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.