WP_Customize_Widgets::get_post_value( string $name, mixed $default_value = null ): mixed
Retrieves an unslashed post value or return a default.
Parameters
-
$name
string Required -
Post value.
-
$default_value
mixed Optional -
Default post value.
Default:
null
Return
mixed Unslashed post value or default value.
Source
File: wp-includes/class-wp-customize-widgets.php
.
View all references
protected function get_post_value( $name, $default_value = null ) {
if ( ! isset( $_POST[ $name ] ) ) {
return $default_value;
}
return wp_unslash( $_POST[ $name ] );
}
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |