WC_REST_Setting_Options_V2_Controller::is_setting_type_valid
Boolean for if a setting type is a valid supported setting type.
Method of the class: WC_REST_Setting_Options_V2_Controller{}
No Hooks.
Returns
true|false.
Usage
$WC_REST_Setting_Options_V2_Controller = new WC_REST_Setting_Options_V2_Controller(); $WC_REST_Setting_Options_V2_Controller->is_setting_type_valid( $type );
- $type(string) (required)
- Type.
Changelog
| Since 3.0.0 | Introduced. |
WC_REST_Setting_Options_V2_Controller::is_setting_type_valid() WC REST Setting Options V2 Controller::is setting type valid code WC 10.3.6
public function is_setting_type_valid( $type ) {
return in_array(
$type,
array(
'text', // Validates with validate_setting_text_field.
'email', // Validates with validate_setting_text_field.
'number', // Validates with validate_setting_text_field.
'color', // Validates with validate_setting_text_field.
'password', // Validates with validate_setting_text_field.
'textarea', // Validates with validate_setting_textarea_field.
'select', // Validates with validate_setting_select_field.
'multiselect', // Validates with validate_setting_multiselect_field.
'radio', // Validates with validate_setting_radio_field (-> validate_setting_select_field).
'checkbox', // Validates with validate_setting_checkbox_field.
'image_width', // Validates with validate_setting_image_width_field.
'thumbnail_cropping', // Validates with validate_setting_text_field.
),
true
);
}