First time working with Wordpress and looking to build a plugin.
In the plugin I create a user to which I want to create a named application password.
Is there a way to programmatically create this password? I cannot find an example of this.
I create my user like this within the Wordpress plugin:
// create the user
$user_id = wp_create_user(
$this->plugin_wp_user_name,
$this->plugin_wp_password_transient,
$this->plugin_wp_user_email
);
$user = get_user_by('id', $user_id);
$user_id = wp_update_user( array(
'ID' => $user_id,
'first_name' => 'API',
'last_name' => 'User',
'display_name' => 'API User',
'description' => 'This user belongs to the App API. Please do not delete.',
'user_url' => $this->plugin_owner_url,
) );