Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function process_demo_login(){
- if(isset($_GET['autologin']) && !is_user_logged_in()){
- $username=$_GET['autologin'];
- $password='demo';
- $user = wp_authenticate($username, $password);
- $secure_cookie = '';
- wp_set_auth_cookie($user->ID, true, $secure_cookie);
- do_action('wp_login', $username);
- wp_redirect(home_url());
- }
- }
- add_action('plugins_loaded','process_demo_login');
Add Comment
Please, Sign In to add comment