Changeset 7879 for trunk/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 02/14/2014 01:59:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-functions.php
r7878 r7879 582 582 * Get a piece of xprofile metadata. 583 583 * 584 * Note that the default value of $single is true, unlike in the case of the 585 * underlying get_metadata() function. This is for backward compatibility. 586 * 584 587 * @param int $object_id ID of the object the metadata belongs to. 585 588 * @param string $object_type Type of object. 'group', 'field', or 'data'. 586 589 * @param string $meta_key Key of the metadata being fetched. If omitted, all 587 590 * metadata for the object will be retrieved. 591 * @param bool $single Optional. If true, return only the first value of the 592 * specified meta_key. This parameter has no effect if meta_key is not 593 * specified. Default: true. 588 594 * @return mixed Meta value if found. False on failure. 589 595 */ 590 function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '' ) {596 function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '', $single = true ) { 591 597 // Legacy - sanitize object type 592 598 if ( ! in_array( $object_type, array( 'group', 'field', 'data' ) ) ) { … … 596 602 add_filter( 'query', 'bp_filter_metaid_column_name' ); 597 603 add_filter( 'query', 'bp_xprofile_filter_meta_query' ); 598 $retval = get_metadata( 'xprofile_' . $object_type, $object_id, $meta_key, true );604 $retval = get_metadata( 'xprofile_' . $object_type, $object_id, $meta_key, $single ); 599 605 remove_filter( 'query', 'bp_filter_metaid_column_name' ); 600 606 remove_filter( 'query', 'bp_xprofile_filter_meta_query' );
Note: See TracChangeset
for help on using the changeset viewer.