customize_post_value_set WordPress Action Hook

The customize_post_value_set hook is triggered when a WordPress Customizer setting is saved. This hook allows you to modify the value of a Customizer setting before it is saved to the database. This can be useful if you need to perform some validation on the value, or if you need to modify the value before it is stored. The first parameter of the hook is the WP_Customize_Setting object for the setting being saved. The second parameter is the new value of the setting. This hook is similar to the customize_value_set hook, but it is specific to Customizer settings.

do_action( 'customize_post_value_set', string $setting_id, mixed $value, WP_Customize_Manager $manager ) #

Announces when any setting’s unsanitized post value has been set.


Description

Fires when the WP_Customize_Manager::set_post_value() method is called.

This is useful for WP_Customize_Setting instances to watch in order to update a cached previewed value.


Top ↑

Parameters

$setting_id

(string)Setting ID.

$value

(mixed)Unsanitized setting post value.

$manager

(WP_Customize_Manager)WP_Customize_Manager instance.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.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