Created
August 13, 2020 17:53
-
-
Save vivirenremoto/3647462fc441bc041815be5e951e8b8d to your computer and use it in GitHub Desktop.
autologin wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('wp-blog-header.php'); | |
$user_login = 'admin'; | |
$user = get_userdatabylogin($user_login); | |
$user_id = $user->ID; | |
wp_set_current_user($user_id, $user_login); | |
wp_set_auth_cookie($user_id); | |
do_action('wp_login', $user_login); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment