Returns the sanitized value for a given setting from the current customized state.
Description
The name "post_value" is a carry-over from when the customized state was exclusively sourced from $_POST['customized']. Nevertheless, the value returned will come from the current changeset post and from the incoming post data.
Parameters
$settingWP_Customize_Setting
A WP_Customize_Setting derived object.
$default_valuemixedoptional
Value returned if $setting has no post value (added in 4.2.0) or the post value is invalid (added in 4.6.0).Default: null
Return
string|mixed
Sanitized value or the $default_value provided.
Uses · 2
is_wp_error()Checks whether the given variable is a WordPress Error.
Signature, return type and hooks compared across 5 parsed releases.
4.6.0
$default_value is now returned early when the setting post value is invalid.from the docblock
4.1.1
Introduced the $default_value parameter.from the docblock
3.4.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/class-wp-customize-manager.php, 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.