customize_changeset_save_data хук-фильтрWP 4.7.0

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

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

Использование

add_filter( 'customize_changeset_save_data', 'wp_kama_customize_changeset_save_data_filter', 10, 2 );

/**
 * Function for `customize_changeset_save_data` filter-hook.
 * 
 * @param array $data    Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata.
 * @param array $context Filter context.
 *
 * @return array
 */
function wp_kama_customize_changeset_save_data_filter( $data, $context ){

	// filter...
	return $data;
}
$data(массив)
Updated changeset data, mapping setting IDs to arrays containing a $value item and optionally other metadata.
$context(массив)

Filter context.

  • uuid(строка)
    Changeset UUID.

  • title(строка)
    Requested title for the changeset post.

  • status(строка)
    Requested status for the changeset post.

  • date_gmt(строка)
    Requested date for the changeset post in MySQL format and GMT timezone.

  • post_id(int|false)
    Post ID for the changeset, or false if it doesn't exist yet.

  • previous_data(массив)
    Previous data contained in the changeset.

  • manager(WP_Customize_Manager)
    Manager instance.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

WP_Customize_Manager::save_changeset_post()
customize_changeset_save_data
wp-includes/class-wp-customize-manager.php 2899
$data = apply_filters( 'customize_changeset_save_data', $data, $filter_context );

Где используется хук в WordPress

Использование не найдено.