Changeset 10198 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 10/07/2015 02:30:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r10163 r10198 276 276 } 277 277 278 function xprofile_get_field( $field_id ) { 279 return new BP_XProfile_Field( $field_id ); 278 /** 279 * Get a profile field object. 280 * 281 * @param int|object $field ID of the field or object representing field data. 282 * @return BP_XProfile_Field|null Field object if found, otherwise null. 283 */ 284 function xprofile_get_field( $field ) { 285 if ( $field instanceof BP_XProfile_Field ) { 286 $_field = $field; 287 } elseif ( is_object( $field ) ) { 288 $_field = new BP_XProfile_Field(); 289 $_field->fill_data( $field ); 290 } else { 291 $_field = BP_XProfile_Field::get_instance( $field ); 292 } 293 294 if ( ! $_field ) { 295 return null; 296 } 297 298 return $_field; 280 299 } 281 300
Note: See TracChangeset
for help on using the changeset viewer.