Thursday 12 August 2021

Create wordpress user using single line code

 $user_id = wp_insert_user( array(

  'user_login' => 'janedoe',

  'user_pass' => 'passwordgoeshere',

  'user_email' => 'jane.doe@example.com',

  'first_name' => 'Jane',

  'last_name' => 'Doe',

  'display_name' => 'Jane Doe',

  'role' => 'editor'

));

No comments:

Post a Comment