Changeset 3514
- Timestamp:
- 12/05/2010 04:39:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile.php
r3436 r3514 598 598 * Fetches profile data for a specific field for the user. 599 599 * 600 * When the field value is serialized, this function unserializes and filters each item in the array 601 * that results. 602 * 600 603 * @package BuddyPress Core 601 * @param $field The ID of the field, or the $name of the field.602 * @param $user_id The ID of the user604 * @param mixed $field The ID of the field, or the $name of the field. 605 * @param int $user_id The ID of the user 603 606 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 604 * @uses BP_XProfile_ProfileData::get_value_by fieldname() Fetches the value based on the params passed.605 * @return The profile field data.607 * @uses BP_XProfile_ProfileData::get_value_byid() Fetches the value based on the params passed. 608 * @return mixed The profile field data. 606 609 */ 607 610 function xprofile_get_field_data( $field, $user_id = null ) { … … 626 629 return false; 627 630 628 return apply_filters( 'xprofile_get_field_data', BP_XProfile_ProfileData::get_value_byid( $field_id, $user_id ) ); 631 $values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field_id, $user_id ) ); 632 633 if ( is_array( $values ) ) { 634 $data = array(); 635 foreach( (array)$values as $value ) { 636 $data[] = apply_filters( 'xprofile_get_field_data', $value ); 637 } 638 } else { 639 $data = apply_filters( 'xprofile_get_field_data', $values ); 640 } 641 642 return $data; 629 643 } 630 644
Note: See TracChangeset
for help on using the changeset viewer.