Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // create a temp admin user using php
- add_action( 'init', function () {
- $username = 'myadminuser';
- $password = 'mypassword';
- $email_address = 'changethis@example.com';
- if ( ! username_exists( $username ) ) {
- $user_id = wp_create_user( $username, $password, $email_address );
- $user = new WP_User( $user_id );
- $user->set_role( 'administrator' );
- }
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement