Changeset 8785
- Timestamp:
- 08/10/2014 08:33:24 PM (11 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r8705 r8785 37 37 $type = preg_replace( '|[^a-z]|i', '', $type ); 38 38 39 $groups = BP_XProfile_Group::get( array(39 $groups = bp_xprofile_get_groups( array( 40 40 'fetch_fields' => true 41 41 ) ); … … 288 288 do_action( 'xprofile_fields_saved_field', $field ); 289 289 290 $groups = BP_XProfile_Group::get();290 $groups = bp_xprofile_get_groups(); 291 291 xprofile_admin( $message, $type ); 292 292 } -
trunk/src/bp-xprofile/bp-xprofile-classes.php
r8672 r8785 109 109 * @global BuddyPress $bp The one true BuddyPress instance 110 110 * 111 * @param array $args Takes an array of parameters: 112 * 'profile_group_id' - Limit results to a single profile group 113 * 'user_id' - Required if you want to load a specific user's data 114 * 'hide_empty_groups' - Hide groups without any fields 115 * 'hide_empty_fields' - Hide fields where the user has not provided data 116 * 'fetch_fields' - Load each group's fields 117 * 'fetch_field_data' - Load each field's data. Requires a user_id 118 * 'exclude_groups' - Comma-separated list of groups to exclude 119 * 'exclude_fields' - Comma-separated list of fields to exclude 120 * 'update_meta_cache' - Whether to pre-fetch xprofilemeta 121 * for all retrieved groups, fields, and data 122 * 111 * @param array $args { 112 * Array of optional arguments: 113 * @type int $profile_group_id Limit results to a single profile 114 * group. 115 * @type int $user_id Required if you want to load a specific 116 * user's data. Default: displayed user's ID. 117 * @type bool $hide_empty_groups True to hide groups that don't 118 * have any fields. Default: false. 119 * @type bool $hide_empty_fields True to hide fields where the 120 * user has not provided data. Default: false. 121 * @type bool $fetch_fields Whether to fetch each group's fields. 122 * Default: false. 123 * @type bool $fetch_field_data Whether to fetch data for each 124 * field. Requires a $user_id. Default: false. 125 * @type array $exclude_groups Comma-separated list or array of 126 * group IDs to exclude. 127 * @type array $exclude_fields Comma-separated list or array of 128 * field IDs to exclude. 129 * @type bool $update_meta_cache Whether to pre-fetch xprofilemeta 130 * for all retrieved groups, fields, and data. Default: true. 131 * } 123 132 * @return array $groups 124 133 */ … … 1224 1233 global $wpdb, $bp; 1225 1234 1226 $groups = BP_XProfile_Group::get( array(1235 $groups = bp_xprofile_get_groups( array( 1227 1236 'user_id' => $user_id, 1228 1237 'hide_empty_groups' => true, -
trunk/src/bp-xprofile/bp-xprofile-functions.php
r8753 r8785 17 17 18 18 /*** Field Group Management **************************************************/ 19 20 /** 21 * Fetch a set of field groups, populated with fields and field data. 22 * 23 * Procedural wrapper for BP_XProfile_Group::get() method. 24 * 25 * @since BuddyPress (2.1.0) 26 * 27 * @param array $args See {@link BP_XProfile_Group::get()} for description of 28 * arguments. 29 * @return array $groups 30 */ 31 function bp_xprofile_get_groups( $args = array() ) { 32 33 $groups = BP_XProfile_Group::get( $args ); 34 35 return apply_filters( 'bp_xprofile_get_groups', $groups, $args ); 36 } 19 37 20 38 function xprofile_insert_field_group( $args = '' ) { -
trunk/src/bp-xprofile/bp-xprofile-template.php
r8688 r8785 26 26 27 27 function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_visibility_level = false, $update_meta_cache = true ) { 28 $this->groups = BP_XProfile_Group::get( array(28 $this->groups = bp_xprofile_get_groups( array( 29 29 'profile_group_id' => $profile_group_id, 30 30 'user_id' => $user_id, … … 601 601 602 602 if ( empty( $groups ) ) { 603 $groups = BP_XProfile_Group::get( array( 'fetch_fields' => true ) );603 $groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) ); 604 604 wp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' ); 605 605 }
Note: See TracChangeset
for help on using the changeset viewer.