Skip to content

Commit 1b95daa

Browse files
committed
Define ABSPATH and load plugin API very early
Before Composer autoload
1 parent 821350b commit 1b95daa

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

templates/wp-config.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111

1212
DEBUG_INFO_INIT: {
1313
$debugInfo = [];
14-
}
14+
} #@@/DEBUG_INFO_INIT
15+
16+
ABSPATH: {
17+
/** Absolute path to the WordPress directory. */
18+
defined('ABSPATH') or define('ABSPATH', realpath(__DIR__ . '{{{WP_INSTALL_PATH}}}') . '/');
19+
20+
/**
21+
* Load plugin.php early, so we can call hooks from here on.
22+
* E.g. in Composer-autoloaded "files".
23+
*/
24+
require_once ABSPATH . 'wp-includes/plugin.php';
25+
} #@@/ABSPATH
1526

1627
AUTOLOAD: {
1728
/** Composer autoload. */
@@ -130,13 +141,7 @@
130141
$table_prefix = $envLoader->read('DB_TABLE_PREFIX') ?: 'wp_';
131142
} #@@/DB_SETUP
132143

133-
/** Absolute path to the WordPress directory. */
134-
defined('ABSPATH') or define('ABSPATH', realpath(__DIR__ . '{{{WP_INSTALL_PATH}}}') . '/');
135-
136144
EARLY_HOOKS : {
137-
/** Load plugin.php early, so we can call hooks from here on. */
138-
require_once ABSPATH . 'wp-includes/plugin.php';
139-
140145
/**
141146
* Load early hooks file if any.
142147
* Early hooks file allows to add hooks that are triggered before plugins are loaded, e.g.

0 commit comments

Comments
 (0)