Last active
April 17, 2018 17:08
-
-
Save everaldomatias/99103dc6852f689d5ba88098e39c614b to your computer and use it in GitHub Desktop.
Função para criar usuário administrador no WordPress via FTP
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
/** | |
* | |
* Função para criar usuário administrador no WordPress via FTP | |
* | |
* @since 17/04/2018 | |
* @see https://brasa.art.br/como-adicionar-um-usuario-no-wordpress-pelo-ftp/ | |
* @return void | |
* | |
*/ | |
function user_by_ftp(){ | |
$user = 'ketchup'; | |
$pass = 'S9XJQjc2*u!D'; | |
$email = 'email@ketchup.com.br'; | |
if ( ! username_exists( $user ) && ! email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} | |
} | |
add_action( 'init','user_by_ftp' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment