WP_Customize_Widgets::get_post_value( string $name, mixed $default = null )

Retrieves an unslashed post value or return a default.


Description Description


Parameters Parameters

$name

(string) (Required) Post value.

$default

(mixed) (Optional) Default post value.

Default value: null


Top ↑

Return Return

(mixed) Unslashed post value or default value.


Top ↑

Source Source

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

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

		return wp_unslash( $_POST[ $name ] );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.