Forcing a login on Wordpress
Posted: Thu Sep 01, 2011 3:20 pm
Hi, thanks for reading...
First of all, I'm not much of a PHP developer, but I've been told what is causing the issue in my code. I have a revised plugin whose function is to take the values from a form submit (name and email) and send it to the admin of the site via email. The site visitor sees this form on pages that the admin specifies as "secure". Once the visitor submits the form, the content of the page is unlocked via a refresh. Here is the part of the code that has the issues:
I've been told that everything here is fine, EXCEPT that the script is not logging in the user before the refresh. Is there a line of code that I can put here to make this work? I've attached the plugin if you need a more in-depth look.
Thanks again for any assistance. And I apologize if I didn't follow any part of the posting protocol properly.
First of all, I'm not much of a PHP developer, but I've been told what is causing the issue in my code. I have a revised plugin whose function is to take the values from a form submit (name and email) and send it to the admin of the site via email. The site visitor sees this form on pages that the admin specifies as "secure". Once the visitor submits the form, the content of the page is unlocked via a refresh. Here is the part of the code that has the issues:
Code: Select all
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action('wp_login', $user_login);
sleep(5);
Thanks again for any assistance. And I apologize if I didn't follow any part of the posting protocol properly.