BP_XProfile_Field_Type_Datebox::validate_settings( array $settings )
Validate date field settings.
Description
Parameters
- $settings
-
(Required) Raw settings.
Return
(array) Validated settings.
Source
File: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | 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.