Skip to content

Commit 3d84794

Browse files
committed
Create WordPress "dev" admin account for local deployments
E.g. when using `grunt deploy`.
1 parent 2f7c2fd commit 3d84794

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

wp-config-sample.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@
6363

6464
/** Sets up WordPress vars and included files. */
6565
require_once __DIR__ . '/wp-settings.php' ;
66+
67+
add_action( 'login_init', function () {
68+
$username = 'dev';
69+
$password = 'dev';
70+
$email = 'dev@localhost';
71+
if ( !username_exists( $username ) ) {
72+
wp_insert_user( [
73+
'user_login' => $username,
74+
'user_pass' => $password,
75+
'user_email' => $email,
76+
'role' => 'administrator',
77+
] );
78+
}
79+
} );

0 commit comments

Comments
 (0)