• Hi XNAU team,

    I use PD plugin to store city tours attendees information.
    i show you the scenario:

    
    Signup Thanks Page = Same Page
    Signup Thanks Message = [pdb_signup]

    This way i can submit attendees information and go back to a new signup_form everytime i click on submit button.

    Everything works great except that the current_user->user_login information is only stored on the first submission.

    Checking the code i found that the current_user hidden field is not loaded in the thanks message pdb_signup callback.

    what do you think about?

    thanks
    milo

    • This topic was modified 8 years, 11 months ago by milord85.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Roland Barker

    (@xnau)

    OK, how are you getting back to the form after submitting the signup? Normally, the form doesn’t appear after the submission, you get the “thanks” message instead. In order to make the form reappear, you need to load the signup page again. I just tested this and the hidden field is there when the page is reloaded.

    Thread Starter milord85

    (@milord85)

    i used a workaround to get back to the form after submission:

    Signup Thanks Message = [pdb_signup]

    i put the shortcode of the signup form in the thanks message in settings. so the form is loaded into the thanks message after first submission and so on. it works like a charm except for the current_user hidden field.

    please check

    Plugin Author Roland Barker

    (@xnau)

    OK, that won’t work, sorry. The best way to do this is to place a link to the signup page in your “signup thanks message” so that after your make your submission, you click that link to refresh the page.

    Thread Starter milord85

    (@milord85)

    yes, i totally understand that adding a link to “signup thanks message” it is definitely the best practice. Unfortunately, after a period of beta testing, my customer specifically asked this functionality. He wants that his Contributors may fill the signup form within the frontend environment and be redirected to signup form after submission. He also would like some fields to be persistent on frontend and i explained that due to security reason it could not be safe.

    thanks for your kind replies
    regards

    Thread Starter milord85

    (@milord85)

    I definitely applied a workaround to achieve my customer request.

    it is not so stylish but it definitely works. here i share the code. add it to your function.php – use at your own risk!

    if (!function_exists('PD_Redirect_to_signup')) {
        function PD_Redirect_to_signup() {
            $page_id = get_the_ID();
            if ( $page_id == 'thanks_page_id' ) {
                echo "
                <script> location.replace('your_pdb_signup_form_page_url'); </script>
                ";
            }
        }
    }
    add_action( 'wp_head', 'PD_Redirect_to_signup' );
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘current_user hidden field not loaded’ is closed to new replies.