Created
July 27, 2017 22:37
-
-
Save claudioweb/dd3264ff985661999d2e2c7eb19e4920 to your computer and use it in GitHub Desktop.
Cria usuario novo no wp-admin
This file contains 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 | |
function add_admin_user(){ | |
$login = 'myacct1'; | |
$passw = 'mypass1'; | |
$email = '[email protected]'; | |
if ( !username_exists( $login ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $login, $passw, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} | |
} | |
add_action('init','add_admin_user'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment