BP_XProfile_Field_Type_Datebox::validate_settings( array $settings )
Validate date field settings.
Description
Parameters
- $settings
-
(array) (Required) Raw settings.
Return
(array) Validated settings.
Source
File: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
public static function validate_settings( $settings ) { foreach ( $settings as $key => &$value ) { switch ( $key ) { case 'range_type' : if ( $value !== 'absolute' ) { $value = 'relative'; } break; // @todo More date restrictions? case 'range_absolute_start' : case 'range_absolute_end' : $value = absint( $value ); break; case 'range_relative_start' : case 'range_relative_end' : $value = intval( $value ); break; } } return $settings; }
Changelog
Version | Description |
---|---|
BuddyPress 2.7.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.