Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am working on a form (Gravity Form) which needs some user authentication when the form is submitted. Gravity's documentation pointed out the place where i should place my code. i.e.

gform_pre_submission_filter

I tried using SimpleModal Login, but problem comes when the user is authenticated and it is redirected either to the dashboard (default) or using redirect_to. This causes all fields reset to defaults.

Question is how can i preserve my form's (gravity form) entries and still authenticate and login the user?

share|improve this question
add comment

1 Answer

As per the Plugin FAQ use,

wp_loginout($_SERVER['REQUEST_URI']);

Sorry that's entirely incorrect, that function prints out the login/out url which you do not need/want for the purpose of using within a filter, instead use,

wp_redirect( $_SERVER['REQUEST_URI'] );

...to return the user to the page they were on.

If that does not allow you to preserve the form field values during the pre submission filter then you might need to pass the form values into the filter and return them. Surely GF would handle this for you.

Let me know.

share|improve this answer
    
surely wp_redirect( $_SERVER['REQUEST_URI'] ); will loose all the form field values. now, can you elaborate (an example will be appreciated) "you might need to pass the form values into the filter and return them" statement –  booota Sep 11 '12 at 18:02
    
any help will be appreciated –  booota Sep 13 '12 at 5:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.