Guest User

Untitled

a guest
Nov 29th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function process_demo_login(){
  2. if(isset($_GET['autologin']) && !is_user_logged_in()){
  3. $username=$_GET['autologin'];
  4. $password='demo';
  5. $user = wp_authenticate($username, $password);
  6. $secure_cookie = '';
  7. wp_set_auth_cookie($user->ID, true, $secure_cookie);
  8. do_action('wp_login', $username);
  9. wp_redirect(home_url());
  10. }
  11. }
  12.  
  13. add_action('plugins_loaded','process_demo_login');
Add Comment
Please, Sign In to add comment