Skip to content

Instantly share code, notes, and snippets.

View ThomasDK81's full-sized avatar

Thomas Blomberg Munkholm ThomasDK81

View GitHub Profile
@ThomasDK81
ThomasDK81 / functions.php
Created November 15, 2018 19:43 — forked from dariodev/functions.php
Programmatically Create a User in WordPress
<?php
// Programmatically Create a User in WordPress
add_action('init', 'prefix_add_user');
function prefix_add_user() {
$username = 'username123';
$password = 'pasword123';
$email = '[email protected]';
$user = get_user_by( 'email', $email );
if( ! $user ) {