How to show custom profile fields in student page

Home Forums Legacy Support Support queries Styling issues How to show custom profile fields in student page

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #205113
    roath
    Spectator
    Hello, In the student page (dashboard), is it possible to show custom profile fields below the name of the student (next to the student's image)? Thank you. Regards, Rodrigo
    #205121
    logan
    Member
    Hello, Please let me know the question with a screenshot & proper demarcation. which fields and where??
    #205287
    roath
    Spectator
    Hello Logan, I've attached an image with the exact position that I want the custom fields to be shown. I would like to show them below the name of the student. https://prnt.sc/ndzkcd The fields that I want to be displayed are two custom profile fields that I've created. Thank you
    #205392
    logan
    Member
    Hello, Yes that is possible, but it depends which details do you want to print there. Refer: https://cl.ly/af9bcd these are the basic details which is printing there. Please paste this snippets in your wp-admin >> plugins >> editor >> wplms-customizer plugin >> wplms-customizer.php  add_action('bp_profile_after_member_header_meta',function(){ global $current_user;                           get_currentuserinfo();                            echo "<h3>Username: " . $current_user->user_login . "</h3></br>";                           echo "<h3>User email: " . $current_user->user_email . "</h3></br>";                           echo "<h3>User first name: " . $current_user->user_firstname . "</h3></br>";                           echo "<h3>User last name: " . $current_user->user_lastname . "</h3></br>";                           echo "<h3>User display name: " . $current_user->display_name . "</h3></br>";                           echo "<h3>User ID: " . $current_user->ID . "</h3></br>"; },99);
    #205556
    roath
    Spectator
    Yes, that's it but I want to show custom profile fields created by me. I've created 2 fields: "profession" and "business type" and I want them to be shown. Thank you.
    #205567
    logan
    Member
    Hello, For that i will need your database access. only then i can check the user_id, meta_key & meta_value only then i will be able to write new codes. Share your c-panel credentials in a private reply. Note: this is a custom feature request but you are our valuable customer that is why i am taking this request. i just want you to have some patience. this could take little time.
    #206761
    roath
    Spectator
    This reply has been marked as private.
    #206924
    logan
    Member
    Hello, Please add profile fields by your own. make these fields mandatory when users fill these items while registering. if it has records only then i will be able to fetch its details from data bas. i don't want to change your custom registration form or profile fields details. or if you are entering these details directly by wp-admin > users > profile fields. that will also work. but i want you to add these items in your profile. then share screenshot of the area you want to print. then i will write new codes for it.
    #207029
    logan
    Member
    Hey there, Please paste this snippets in your wp-admin >> plugins >> editor >> wplms-customizer plugin >> wplms-customizer.php Or in Please add this code in your wplms-customizer.php file in wplms customizer plugin by using your FTP/SFTP/cpanel: add_action('bp_profile_after_member_header_meta',function(){ if(!is_user_logged_in()){ return; }else{ $user_id = bp_displayed_user_id(); $user = get_user_by('id',$user_id); //get_currentuserinfo(); echo "<span>User ID: " . $user->id . "</span></br>"; echo "<span>Username: " . $user->user_login . "</span></br>"; echo "<span>User email: " . $user->user_email . "</span></br>"; echo "<span>User first name: " . $user->user_firstname . "</span></br>"; echo "<span>User last name: " . $user->user_lastname . "</span></br>"; echo "<span>User display name: " . $user->display_name . "</span></br>"; } },99);
    #208671
    roath
    Spectator
    This reply has been marked as private.
    #208889
    logan
    Member
    Actually, i need to check the meta key of the registration form field. please share screenshot of the form. also, i will need your database access only then it is feasible.
    #209313
    roath
    Spectator
    Hello Logan, I have a good understanding of SQL queries and I usually extract data via direct query in the database. What meta_key? I checked the tables bp_xprofile_fields, data and meta but didn't find this field. But I can show the results from the table bp_xprofile_fields for the two custom fields: Field: "Cargo" id = 14, group_id = 1, parent_id = 0, type = selectbox, name = "Cargo", description = '', is_required = 1, is_default_option = 0, field_order = 4, option_order = 0, order_by = 'asc', can_delete = 1 Field: "Setor de Trabalho" id = 22, group_id = 1, parent_id = 0, type = selectbox, name = "Setor de Trabalho (em caso de estudante, escolher setor aonde pretende fazer o estágio)", description = '', is_required = 1, is_default_option = 0, field_order = 5, option_order = 0, order_by = 'asc', can_delete = 1 The "options" id's for the field_id = 14 are between 212 -226 (items for the selectbox) The "options" id's for the field_id = 22 are between 165 -185 If you need any more query results I can provide it here.   Thanks.
    #209436
    logan
    Member
    Hello, Please provide your ftp credentials and admin credentials in a private reply. i will check this on your end. lets finalize it. add_action('bp_profile_after_member_header_meta',function(){   if(!is_user_logged_in()){   return;   }else{   $user_id = bp_displayed_user_id();   $user = get_user_by('id',$user_id);   //get_currentuserinfo(); $field1 = 12; $field2= 16; echo "<span>User ID: " . $user->id . "</span></br>";   echo "<span>Username: " . $user->user_login . "</span></br>";   echo "<span>User email: " . $user->user_email . "</span></br>";   echo "<span>User first name: " . $user->user_firstname . "</span></br>";   echo "<span>User last name: " . $user->user_lastname . "</span></br>";   echo "<span>User display name: " . $user->display_name . "</span></br>";   echo "<span>Field 1: " . bp_get_profile_field_data( 'field='.$field1 .'&user_id=' . $user->id) . "</span></br>"; echo "<span>Field 2: " . bp_get_profile_field_data( 'field='.$field2 .'&user_id=' . $user->id) . "</span></br>";   ; }   },99);
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘How to show custom profile fields in student page’ is closed to new replies.