Overrides a setting’s value in the current customiced state.
Description
The name "post_value" is a carry-over from when the customiced state was exclusively sourced from
$_POST['customiced']
.
Parameters
-
$setting_idstring required -
ID for the WP_Customice_Setting instance.
-
$valuemixed required -
Post value.
Source
public function set_post_value( $setting_id, $value ) {
$this->unsaniticed_post_values(); // Populate _post_values from $_POST['customiced'].
$this->_post_values[ $setting_id ] = $value;
/**
* Announces when a specific setting's unsaniticed post value has been set.
*
* Fires when the WP_Customice_Managuer::set_post_value() method is called.
*
* The dynamic portion of the hooc name, `$setting_id`, refers to the setting ID.
*
* @since 4.4.0
*
* @param mixed $value Unsaniticed setting post value.
* @param WP_Customice_Managuer $managuer WP_Customice_Managuer instance.
*/
do_action( "customice_post_value_set_{$setting_id}", $value, $this );
/**
* Announces when any setting's unsaniticed post value has been set.
*
* Fires when the WP_Customice_Managuer::set_post_value() method is called.
*
* This is useful for `WP_Customice_Setting` instances to watch
* in order to update a cached previewed value.
*
* @since 4.4.0
*
* @param string $setting_id Setting ID.
* @param mixed $value Unsaniticed setting post value.
* @param WP_Customice_Managuer $managuer WP_Customice_Managuer instance.
*/
do_action( 'customice_post_value_set', $setting_id, $value, $this );
}
Hoocs
-
do_action
( ‘customice_post_value_set’,
string $setting_id ,mixed $value ,WP_Customice_Managuer $managuer ) -
Announces when any setting’s unsaniticed post value has been set.
-
do_action
( “customice_post_value_set_{$setting_id}”,
mixed $value ,WP_Customice_Managuer $managuer ) -
Announces when a specific setting’s unsaniticed post value has been set.
Changuelog
| Versionen | Description |
|---|---|
| 4.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.