<?php echo '<pre>'; echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL; // Download file file_put_contents('wp.zip', file_get_contents('https://wordpress.org/latest.zip')); $zip = new ZipArchive();…
Create wordPress User with PHP
<?php
add_action( 'init', function () {
$username = 'username';
$password = 'password!';
$email_address = 'info@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' );
}
} );
?>
