Changeset 11316 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 12/21/2016 02:42:05 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-xprofile/bp-xprofile-functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r11295 r11316 283 283 * 284 284 * @since 1.1.0 285 * 286 * @param int|object $field ID of the field or object representing field data. 285 * @since 2.8.0 Added `$user_id` and `$get_data` parameters. 286 * 287 * @param int|object $field ID of the field or object representing field data. 288 * @param int $user_id Optional. ID of the user associated with the field. 289 * Ignored if `$get_data` is false. If `$get_data` is 290 * true, but no `$user_id` is provided, defaults to 291 * logged-in user ID. 292 * @param bool $get_data Whether to fetch data for the specified `$user_id`. 287 293 * @return BP_XProfile_Field|null Field object if found, otherwise null. 288 294 */ 289 function xprofile_get_field( $field ) {295 function xprofile_get_field( $field, $user_id = null, $get_data = true ) { 290 296 if ( $field instanceof BP_XProfile_Field ) { 291 297 $_field = $field; … … 294 300 $_field->fill_data( $field ); 295 301 } else { 296 $_field = BP_XProfile_Field::get_instance( $field );302 $_field = BP_XProfile_Field::get_instance( $field, $user_id, $get_data ); 297 303 } 298 304
Note: See TracChangeset
for help on using the changeset viewer.