Skip to content

Instantly share code, notes, and snippets.

@sagarjadhav
Last active February 3, 2020 17:13
Show Gist options
  • Save sagarjadhav/56eec4dee4792ea4fce1689a6a300e89 to your computer and use it in GitHub Desktop.
Save sagarjadhav/56eec4dee4792ea4fce1689a6a300e89 to your computer and use it in GitHub Desktop.
<?php
// Xprofile get fileds by group
if ( bp_has_profile( array( 'user_id' => $user_id ) ) ) {
while ( bp_profile_groups() ) : bp_the_profile_group();
$group_name = bp_get_the_profile_group_name();
if ( ( 'Social' == $group_name) && bp_profile_group_has_fields() ) {
echo '<div id="bb-profile-group-fields">';
while ( bp_profile_fields() ) : bp_the_profile_field();
if ( bp_field_has_data() ) :
$name = bp_get_the_profile_field_name();
$class = sanitize_title( $name );
$value = bp_get_the_profile_field_edit_value();
echo '<a href="' . esc_url( $value ) . '" ><i class="fa fa-' . $class . '" aria-hidden="true"></i></a> ';
endif;
endwhile;
echo '</div>';
}
endwhile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment