WP_Customize_Setting::post_value() WordPress Method

The WP_Customize_Setting::post_value() method is used to retrieve the value of a setting from the current POST request. This is useful for previewing changes to a setting before they are saved.

WP_Customize_Setting::post_value( mixed $default_value = null ) #

Fetch and sanitize the $_POST value for the setting.


Description

During a save request prior to save, post_value() provides the new value while value() does not.


Top ↑

Parameters

$default_value

(mixed)(Optional)A default value which is used as a fallback.

Default value: null


Top ↑

Return

(mixed) The default value on failure, otherwise the sanitized and validated value.


Top ↑

Source

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

	final public function post_value( $default_value = null ) {
		return $this->manager->post_value( $this, $default_value );
	}


Top ↑

Changelog

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