BuddyPress – Get a List of Defined xProfile fields olatechproJune 7, 20236 Views “How can I retrieve all xProfile fields?” Post Views: 6 Related postsGet rid of this Strict Standards warningWooCommerce: get_current_screen not working with multi languageCan’t login on WordPressForce HTTPS using .htaccess – stuck in redirect loopWordPress: Ajax not working to insert, query and result dataHow Can I pass an image file to wp_handle_upload?
You can pass the user id in Bp Profile loop to get hold of alll the fields and their values. <?php if ( bp_has_profile(array('user_id' => 1)) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?> <ul id="profile-groups"> <?php if ( bp_profile_group_has_fields() ) : ?> <li> <?php bp_the_profile_group_name() ?> <ul id="profile-group-fields"> <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( bp_field_has_data() ) : ?> <li> <?php bp_the_profile_field_name() ?> <?php bp_the_profile_field_value() ?> </li> <?php endif; ?> <?php endwhile; ?> </ul> <li> <?php endif; ?> </ul> <?php endwhile; ?> <?php else: ?> <div id="message" class="info"> <p>This user does not have a profile.</p> </div> <?php endif;?> This will give you group name and all the fields name, with values
You can pass the user id in Bp Profile loop to get hold of alll the fields and their values.
This will give you group name and all the fields name, with values