BP_XProfile_Field_Type_Datebox::get_field_settings( int $field_id )
Get settings for a given date field.
Description
Parameters
- $field_id
-
(Required) ID of the field.
Return
(array)
Source
File: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
public static function get_field_settings( $field_id ) {
$defaults = array(
'date_format' => 'Y-m-d',
'date_format_custom' => '',
'range_type' => 'absolute',
'range_absolute_start' => date( 'Y' ) - 60,
'range_absolute_end' => date( 'Y' ) + 10,
'range_relative_start' => '-10',
'range_relative_end' => '20',
);
$settings = array();
foreach ( $defaults as $key => $value ) {
$saved = bp_xprofile_get_meta( $field_id, 'field', $key, true );
if ( $saved ) {
$settings[ $key ] = $saved;
} else {
$settings[ $key ] = $value;
}
}
$settings = self::validate_settings( $settings );
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.