Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › custom registration fields are not saved or visible in admin
- This topic has 10 replies, 3 voices, and was last updated 4 years, 4 months ago by logan.
Viewing 11 posts - 1 through 11 (of 11 total)
-
AuthorPosts
-
October 13, 2019 at 9:06 pm #229927MeesterGijsSpectatorHi, 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 );October 14, 2019 at 6:48 am #229985loganMemberalready 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.October 14, 2019 at 6:55 am #229991MeesterGijsSpectatorThat 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 );October 14, 2019 at 7:03 am #229997MeesterGijsSpectatorAnd 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..October 15, 2019 at 2:29 pm #230229Anshuman SahuKeymasterNopee 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_dataOctober 15, 2019 at 7:01 pm #230252MeesterGijsSpectatorDear 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)" GijsOctober 16, 2019 at 8:01 am #230331loganMemberhello, 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.October 21, 2019 at 8:02 pm #230871MeesterGijsSpectatorWhen 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). GijsOctober 22, 2019 at 1:40 pm #230963Anshuman SahuKeymasterThis 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 );October 22, 2019 at 10:42 pm #230998MeesterGijsSpectatorThat 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, GijsOctober 23, 2019 at 7:03 am #231029loganMemberThis reply has been marked as private. -
AuthorPosts
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.