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.
Return
Mixed. Unslashed post value or default value.
Usage
// protected - for code of main (parent) or child class $result = $this->get_post_value( $name, $default );
- $name(string) (required)
- Post value.
- $default(mixed)
- Default post value.
Default: null
Changelog
Since 3.9.0 | Introduced. |
Code of WP_Customize_Widgets::get_post_value() 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 ] );
}