Custom signup form displaying wrong data in backend
-
Hi!
I’ve been helped very much by the support theme on a previous issue. This is a problem that has turned up while working with the solution on my previous issue. Here is the thing:
I’ve got a website: rost.wpengine.com. On this website I use a theme with the plugin LearnPress and LearnPress BuddyPress Integration. I use the custom signup form from Buddypress to make a custom signup form. The next step was displaying the filled in fields in the backend of the LearnPress orders. This is working thanks to you guys. I added in bp-custom.php the following code:
<?php function bptest_show_a_field () { $user_id = bp_loggedin_user_id(); $firstname = xprofile_get_field_data( 'First Name', bp_loggedin_user_id(), $multi_format = 'comma' ); $lastname = xprofile_get_field_data( 'Last Name', bp_loggedin_user_id(), $multi_format = 'comma' ); $birth = xprofile_get_field_data( 'Date of birth', bp_loggedin_user_id(), $multi_format = 'comma' ); $education = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' ); $profession = xprofile_get_field_data( 'Profession', bp_loggedin_user_id(), $multi_format = 'comma' ); if ( ! $firstname && ! $lastname && ! $birth && ! $education && ! $profession ) { return; } else { echo 'Voornaam: ' . $firstname . '<br />' ; echo 'Achternaam: ' . $lastname . '<br />' ; echo 'Geboortedatum: ' . $birth . '<br />' ; echo 'Hoogste graad: ' . $education . '<br />' ; echo 'Beroep: ' . $profession . '<br />' ; } } add_action ( 'user_a_field', 'bptest_show_a_field' ); ?>
Then I added this to order.php in LearnPress to display the filled in fields in the backend of LearnPress in WordPress:
do_action ( 'user_a_field' );
This is working, but it is displaying the data filled in by the person who is logged in in the orders. So me, David, sees the data of the custom fields I filled in in EVERY order while it should display the data of the user that filled in the custom fields while filling in the registration form. I hope you understand what my problem is (I’m Dutch).
This is the backend of LearnPress with the custom fields (custom fields like ‘Beroep’ and ‘geboortedatum’)
I hope you can help me out!!
David
- The topic ‘Custom signup form displaying wrong data in backend’ is closed to new replies.