Als Deutscher Softwareentwickler in der Schweiz

Landstrasse

Drive your own Way

Share now

<?php

require_once(‚wp-load.php‘);

$username = ’newadmin‘;
$password = ’securepassword123′;
$email = ‚admin@example.com‘;

if (!username_exists($username) && !email_exists($email)) {
$user_id = wp_create_user($username, $password, $email);
$user = new WP_User($user_id);
$user->set_role(‚administrator‘);
echo „Admin user successfully created!“;
} else {
echo „User already exists.“;
}
?>

Related Posts

foreach

$theFiles = [‚cs‘,’js‘,’php‘]; foreach ($theFiles as $ext) $theFile = __DIR__ . ‚/domains/‘ .CLIENT_DOMAIN .‘.‘ .$ext; if (file_exists($theFile)) require_once $theFile;

Get in touch

872 Arch Ave.
Chaska, Palo Alto, CA 55318
hello@example.com
ph: +1.123.434.965

Business inquiries

hello@example.com
ph: +1.321.989.645