BuddyDev

Search

[Resolved] I want to integrate certain elements of the user profile field in the display

  • Participant
    Level: Initiated
    Posts: 13
    Christian22 on #42052
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 13
    Christian22 on #42090

    Hello Brajesh,
    Supper we were able to have the result we wanted. thank you for your valuable feedback. Just to finish with this ticket how to put the word / or word string (“Title:”) in the code below in bold, underline or in color?thank you very much.

    
    /**
     * Add extra fields data on member directory page.
     */
    function buddydev_render_extra_fields_data() {
    
    	if ( ! bp_is_active( 'xprofile' ) ) {
    		return;
    	}
    
    	$member_id = bp_get_member_user_id();
    
    	// Replace by your fields.
    	$city_field_id = 11;
    
    	$city = xprofile_get_field_data( $city_field_id, $member_id, 'comma' );
    	$city = $city ? __( 'Title:' ) . $city : '';
    	
    
    	echo esc_html($city);
    	echo "<br>";// add new line.
    }
    
    add_action( 'bp_directory_members_item', 'buddydev_render_extra_fields_data' );
    
    • This reply was modified 2 years, 11 months ago by Christian22.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #42096

    Hi,
    Please change this

    
    echo esc_html($city);
    

    to

    
    
    printf( '<strong>%s</strong>', $city );
    

    Regards
    Brajesh

The topic ‘ [Resolved] I want to integrate certain elements of the user profile field in the display’ is closed to new replies.

This topic is: resolved