diff --git a/src/bp-xprofile/bp-xprofile-functions.php b/src/bp-xprofile/bp-xprofile-functions.php
index 21ffe7b..555eee4 100644
a
|
b
|
function bp_xprofile_is_richtext_enabled_for_field( $field_id = null ) { |
1130 | 1130 | } |
1131 | 1131 | |
1132 | 1132 | /** |
| 1133 | * Does this profile field support multiple values? |
| 1134 | * |
| 1135 | * @since 2.9.0 |
| 1136 | * |
| 1137 | * @param int|null $field_id Optional. Default current field ID. |
| 1138 | * @return bool Whether the field supports multiple values |
| 1139 | */ |
| 1140 | function bp_xprofile_field_supports_multiple_values( $field_id = null ) { |
| 1141 | if ( ! $field_id ) { |
| 1142 | $field_id = bp_get_the_profile_field_id(); |
| 1143 | } |
| 1144 | |
| 1145 | $field = xprofile_get_field( $field_id, null, false ); |
| 1146 | |
| 1147 | $supports = false; |
| 1148 | if ( $field instanceof BP_XProfile_Field ) { |
| 1149 | $supports = (bool) $field->type_obj->supports_multiple_values; |
| 1150 | } |
| 1151 | |
| 1152 | /** |
| 1153 | * Filters whether the given field supports multiple values. |
| 1154 | * |
| 1155 | * @since 2.9.0 |
| 1156 | * |
| 1157 | * @param bool $supports True if the field supports multiple values, otherwise false. |
| 1158 | * @param int $field_id ID of the field. |
| 1159 | */ |
| 1160 | return (bool) apply_filters( 'bp_xprofile_field_supports_multiple_values', $supports, $field_id ); |
| 1161 | } |
| 1162 | |
| 1163 | /** |
1133 | 1164 | * Get visibility levels out of the $bp global. |
1134 | 1165 | * |
1135 | 1166 | * @since 1.6.0 |
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php b/src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php
index 7267ad9..a4a2167 100644
a
|
b
|
class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { |
28 | 28 | $this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' ); |
29 | 29 | $this->name = _x( 'Checkboxes', 'xprofile field type', 'buddypress' ); |
30 | 30 | |
| 31 | $this->supports_multiple_values = true; |
31 | 32 | $this->supports_multiple_defaults = true; |
32 | 33 | $this->accepts_null_value = true; |
33 | 34 | $this->supports_options = true; |
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php b/src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
index 5ecaa10..af92d00 100644
a
|
b
|
class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { |
28 | 28 | $this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' ); |
29 | 29 | $this->name = _x( 'Multi Select Box', 'xprofile field type', 'buddypress' ); |
30 | 30 | |
| 31 | $this->supports_multiple_values = true; |
31 | 32 | $this->supports_multiple_defaults = true; |
32 | 33 | $this->accepts_null_value = true; |
33 | 34 | $this->supports_options = true; |
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field-type.php b/src/bp-xprofile/classes/class-bp-xprofile-field-type.php
index f282a82..75035dd 100644
a
|
b
|
abstract class BP_XProfile_Field_Type { |
66 | 66 | public $supports_options = false; |
67 | 67 | |
68 | 68 | /** |
| 69 | * If allowed to store multiple values. |
| 70 | * |
| 71 | * @since 2.9.0 |
| 72 | * @var bool Does this field support multiple values? e.g. multiselectbox, checkbox. |
| 73 | */ |
| 74 | public $supports_multiple_values = false; |
| 75 | |
| 76 | /** |
69 | 77 | * If allowed to support multiple options as default. |
70 | 78 | * |
71 | 79 | * @since 2.0.0 |