custom registration fields are not saved or visible in admin

Home Forums Legacy Support Support queries How-to & Troubleshooting custom registration fields are not saved or visible in admin

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #229927
    MeesterGijs
    Spectator
    Hi, I'm so happy. I just changed my registration and checkout. But... I now I use the correct code, registration fields are still the same. Though I don't see three bits of info in my admin, or even more worrying in my database. I need this fixed as soon as possible. This is the database of a usermee I just created. Kobe (password: Welkom01!) This is what I see in admin and how the registration looks like.. This is the code: /* Voeg checkout fields columns toe aan gebruikers admin overzicht */ function new_modify_user_table( $column ) { $column['field_865'] = 'Niveau'; $column['field_1442'] = 'Locatie school'; $column['field_847'] = 'Geboortejaar'; return $column; } add_filter( 'manage_users_columns', 'new_modify_user_table' ); /* Voeg informatie uit custom checkout fields toe aan gebruikers admin overzicht */ function new_modify_user_table_row( $val, $column_name, $user_id ) { switch ($column_name) { case 'field_865' : return get_the_author_meta( 'field_865', $user_id ); break; case 'field_1442' : return get_the_author_meta( 'field_1442', $user_id ); break; case 'field_847' : return get_the_author_meta( 'field_847', $user_id ); break; default: } return $val; } add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
    #229985
    logan
    Member
    already replied for this in another topic. as you stated earlier you are removing styling codes and customizer codes, i think that is the reason massive issues are generated. you messed i believe.
    #229991
    MeesterGijs
    Spectator
    That might be so. But that's an assumption and doesn't solve my issue. Sorry. I work very precise, of course sometimes things mess up. But I'm here to fix it. What could be wrong with this code? It's still the same field numbers. It's now at /aanmelden, but that's not related to the code. Please have look. /* Voeg checkout fields columns toe aan gebruikers admin overzicht */ function new_modify_user_table( $column ) { $column['field_865'] = 'Niveau'; $column['field_1442'] = 'Locatie school'; $column['field_847'] = 'Geboortejaar'; return $column; } add_filter( 'manage_users_columns', 'new_modify_user_table' ); /* Voeg informatie uit custom checkout fields toe aan gebruikers admin overzicht */ function new_modify_user_table_row( $val, $column_name, $user_id ) { switch ($column_name) { case 'field_865' : return get_the_author_meta( 'field_865', $user_id ); break; case 'field_1442' : return get_the_author_meta( 'field_1442', $user_id ); break; case 'field_847' : return get_the_author_meta( 'field_847', $user_id ); break; default: } return $val; } add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
    #229997
    MeesterGijs
    Spectator
    And I remember I did some query request in phpmyadmin (database) for some difficult issues. That was a year ago. Could that be a solution? And what should I then do? Because I have no exact memory of it..
    #230229
    Anshuman Sahu
    Keymaster
    Nopee that code you have above will not work . That code will not pull the profile field data from custom registration form . However we cannot show this profile field data until the user account gets activated and the fields get saved .   Please use this function instead of get_the_author_meta :  bp_get_profile_field_data  
    #230252
    MeesterGijs
    Spectator
    Dear Alex, Thanks I immediately gave it a try. But I now see no saved that from my existing 2000 members. screenshot Using both code gave me this error. And also will the data remain visible in their profile page? What to do? "Jouw PHP-wijzigingen zijn teruggedraaid vanwege een fout op regel 650 in het bestand wp-content/plugins/wplms-customizer/wplms-customizer.php. Repareer en probeer opnieuw. Cannot redeclare new_modify_user_table() (previously declared in wp-content/plugins/wplms-customizer/wplms-customizer.php:189)" Gijs
    #230331
    logan
    Member
    hello, This error says your function is already defined; which can mean : – you have the same function defined in two files – or you have the same function defined in two places in the same file – or the file in which your function is defined is included two times (so, it seems the function is defined two times).
    Please check the error logs on your server for a more specific error message, which may give a clue to why this is happening on your website/server. If you are using cPanel, the following tutorial has more information about the error log in cPanel: How to view cPanel Error logs . If you need help locating them, ask your hosting provider to help you with that.
    #230871
    MeesterGijs
    Spectator
    When I use your code (bp_get_profile_field_data) the fields remain empty. The field_numbers are still the same. Any idea why they are not visible in my admin? Does it have anything to do that they first were collected at the checkout page and now at the registration page? And I would think that because these are fields at the registration page (meestergijs.nl/aanmelden) that they would automatically be saved/connected to user(name). Gijs
    #230963
    Anshuman Sahu
    Keymaster
    This should work for you :     function new_modify_user_table( $column ) { $column['field_865'] = 'Niveau'; $column['field_1442'] = 'Locatie school'; $column['field_847'] = 'Geboortejaar'; return $column; } add_filter( 'manage_users_columns', 'new_modify_user_table' );   /* Voeg informatie uit custom checkout fields toe aan gebruikers admin overzicht */ function new_modify_user_table_row( $val, $column_name, $user_id ) { switch ($column_name) { case 'field_865' : $field = bp_get_profile_field_data(array('field' => 865, 'user_id' => $user_id)); return $field ; break; case 'field_1442' : $field = bp_get_profile_field_data(array('field' => 1442, 'user_id' => $user_id)); return $field ; break; case 'field_847' : $field = bp_get_profile_field_data(array('field' => 847, 'user_id' => $user_id)); return $field ; break; default: } return $val; } add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
    #230998
    MeesterGijs
    Spectator
    That was f**king magic! I loved that. I was afraid that it would show data of those field from only the new members that use the registration page. But it now shows both the old and new way of registering. Great!! Btw, I do miss their names now. This column. Any idea on how to fix this? I'm trying to get these fields visible in profile page (/studenten/username/profile/edit/group/1/) so I might have to change this one more time. But on the other hand, those field_numbers will still be the same. You can close this, Alex. Thanks! Btw, say hi to Logan as well. He's been helping me tremendously. And Veronica lately as well. :) Bye, Gijs
    #231029
    logan
    Member
    This reply has been marked as private.
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘custom registration fields are not saved or visible in admin’ is closed to new replies.