Skip to content

Instantly share code, notes, and snippets.

@trangsihung
Last active July 26, 2017 02:46
Show Gist options
  • Save trangsihung/da1a03b42b7cd89f0be6b6c1c333dc26 to your computer and use it in GitHub Desktop.
Save trangsihung/da1a03b42b7cd89f0be6b6c1c333dc26 to your computer and use it in GitHub Desktop.
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