File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 64
64
/** Sets up WordPress vars and included files. */
65
65
require_once __DIR__ . '/wp-settings.php ' ;
66
66
67
- add_action ( 'login_init ' , function () {
67
+ // Auto-create an admin account for local development
68
+ //
69
+ // https://codex.wordpress.org/Plugin_API/Action_Reference
70
+ //
71
+ // The 'init' and 'wp_loaded' hooks would be great hooks for this purpose
72
+ // if this code was in any other file (e.g. theme or plugin). Here in
73
+ // wp-config.php, add_action is either undefined (before wp-settings.php),
74
+ // or it's too later as those those hooks *just* fired at the end of
75
+ // the wp-settings.php file. So, instead, just call it directly.
76
+ function jquery_dev_autocreate_dev_admin () {
68
77
$ username = 'dev ' ;
69
78
$ password = 'dev ' ;
70
79
$ email = 'dev@localhost ' ;
76
85
'role ' => 'administrator ' ,
77
86
] );
78
87
}
79
- } );
88
+ }
89
+ jquery_dev_autocreate_dev_admin ();
You can’t perform that action at this time.
0 commit comments