WordPress at a glance
function is not described

WP_Customize_Widgets::get_post_value() protected WP 3.9.0

Retrieves an unslashed post value or return a default.

{} It's a method of the class: WP_Customize_Widgets{}

No Hooks.


Mixed. Unslashed post value or default value.


// protected - for code of main (parent) or child class
$result = $this->get_post_value( $name, $default );
$name(string) (required)
Post value.
Default post value.
Default: null


Since 3.9.0 Introduced.

Code of WP_Customize_Widgets::get_post_value() WP 5.6

protected function get_post_value( $name, $default = null ) {
	if ( ! isset( $_POST[ $name ] ) ) {
		return $default;

	return wp_unslash( $_POST[ $name ] );