Changeset 8819
- Timestamp:
- 08/13/2014 12:30:12 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress/members/register.php
r8686 r8819 105 105 <?php endwhile; ?> 106 106 107 <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_ group_field_ids(); ?>" />107 <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_field_ids(); ?>" /> 108 108 109 109 <?php endwhile; endif; endif; ?> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
r8688 r8819 64 64 </div> 65 65 66 <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_ group_field_ids(); ?>" />66 <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" /> 67 67 68 68 <?php wp_nonce_field( 'bp_xprofile_edit' ); ?> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php
r8214 r8819 47 47 <?php wp_nonce_field( 'bp_xprofile_settings' ); ?> 48 48 49 <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_ group_field_ids(); ?>" />49 <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" /> 50 50 51 51 </form> -
trunk/src/bp-xprofile/bp-xprofile-actions.php
r8678 r8819 86 86 $posted_field_ids = explode( ',', $_POST['field_ids'] ); 87 87 88 // Backward compatibility: a bug in BP 2.0 caused only a single 89 // group's field IDs to be submitted. Look for values submitted 90 // in the POST request that may not appear in 'field_ids', and 91 // add them to the list of IDs to save. 92 foreach ( $_POST as $posted_key => $posted_value ) { 93 preg_match( '/^field_([0-9]+)_visibility$/', $posted_key, $matches ); 94 if ( ! empty( $matches[1] ) && ! in_array( $matches[1], $posted_field_ids ) ) { 95 $posted_field_ids[] = $matches[1]; 96 } 97 } 98 88 99 // Save the visibility settings 89 100 foreach ( $posted_field_ids as $field_id ) { -
trunk/src/bp-xprofile/bp-xprofile-template.php
r8785 r8819 313 313 314 314 return substr( $field_ids, 0, -1 ); 315 } 316 317 /** 318 * Output a comma-separated list of field IDs that are to be submitted on profile edit. 319 * 320 * @since BuddyPress (2.1.0) 321 */ 322 function bp_the_profile_field_ids() { 323 echo bp_get_the_profile_field_ids(); 324 } 325 /** 326 * Generate a comma-separated list of field IDs that are to be submitted on profile edit. 327 * 328 * @since BuddyPress (2.1.0) 329 * 330 * @return string 331 */ 332 function bp_get_the_profile_field_ids() { 333 global $profile_template; 334 335 $field_ids = array(); 336 foreach ( $profile_template->groups as $group ) { 337 $field_ids = array_merge( $field_ids, wp_list_pluck( $group->fields, 'id' ) ); 338 } 339 340 $field_ids = implode( ',', wp_parse_id_list( $field_ids ) ); 341 342 return apply_filters( 'bp_get_tthe_profile_field_ids', $field_ids ); 315 343 } 316 344
Note: See TracChangeset
for help on using the changeset viewer.