Skip to content

Commit 771b2e1

Browse files
authored
Merge pull request #105 from humanmade/eager-bootstrap
Eager bootstrapping of the plugin
2 parents a7bb0d3 + 2471886 commit 771b2e1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

inc/namespace.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ function maybe_populate_site_option() {
143143
return;
144144
}
145145

146-
$cavalcade_db_version = get_option( 'cavalcade_db_version' );
147-
148-
$set_site_meta = function ( $site_meta ) use ( $cavalcade_db_version ) {
149-
$site_meta['cavalcade_db_version'] = $cavalcade_db_version;
146+
$set_site_meta = function ( $site_meta ) {
147+
$site_meta['cavalcade_db_version'] = get_option( 'cavalcade_db_version' );
150148
return $site_meta;
151149
};
152150

plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
require __DIR__ . '/inc/connector/namespace.php';
2020
require __DIR__ . '/inc/upgrade/namespace.php';
2121

22-
add_action( 'plugins_loaded', __NAMESPACE__ . '\\bootstrap' );
22+
bootstrap();
2323

2424
// Register cache groups as early as possible, as some plugins may use cron functions before plugins_loaded
2525
if ( function_exists( 'wp_cache_add_global_groups' ) ) {

tests/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/**
33
* Bootstrap the plugin unit testing environment.
44
*
5+
* phpcs:disable PSR1.Files.SideEffects
6+
*
57
* @package WordPress
68
*/
79

0 commit comments

Comments
 (0)