Skip to content

Instantly share code, notes, and snippets.

@trangsihung

trangsihung/auto-login.php Secret

Last active Jul 26, 2017
Embed
What would you like to do?
one-file-one-post
<?php
function autologin() {
if ($_GET['autologin'] == 'demo') {
$creds['user_login'] = 'demo'; // username
$creds['user_password'] = 'demo'; // password
$creds['remember'] = true;
$autologin_user = wp_signon( $creds, false );
if ( is_wp_error($autologin_user) )
echo $autologin_user->get_error_message();
}
}
add_action( 'after_setup_theme', 'autologin' );
<?php
add_filter( 'auto_update_plugin', '__return_true' ); // Tự đông update plugins
add_filter( 'auto_update_theme', '__return_true' ); // Tự đông update themes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment