Changeset 5962
- Timestamp:
- 04/06/2012 10:50:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-functions.php
r5927 r5962 152 152 * @param mixed $field The ID of the field, or the $name of the field. 153 153 * @param int $user_id The ID of the user 154 * @param string $multi_format How should array data be returned? 'comma' if you want a 155 * comma-separated string; 'array' if you want an array 154 156 * @uses BP_XProfile_ProfileData::get_value_byid() Fetches the value based on the params passed. 155 157 * @return mixed The profile field data. 156 158 */ 157 function xprofile_get_field_data( $field, $user_id = 0 ) {159 function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' ) { 158 160 159 161 if ( empty( $user_id ) ) … … 177 179 foreach( (array) $values as $value ) { 178 180 $data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id ); 181 } 182 183 if ( 'comma' == $multi_format ) { 184 $data = implode( ', ', $data ); 179 185 } 180 186 } else {
Note: See TracChangeset
for help on using the changeset viewer.