Skip to content

Commit

Permalink
Load ETK common code before the plugins_loaded action (#51158)
Browse files Browse the repository at this point in the history
`common/index.php` contains helper functions that would be useful when
other ETK modules are being setup during the `plugins_loaded` action.
Unfortunately they can't be used though, because those helper functions
are defined as part of `plugins_loaded` too.

There's nothing in `common/index.php` that means loading it should be
delayed. So moving the `require_once` call so that it gets loaded as
soon as `full-site-editing-plugin.php` is loaded.
  • Loading branch information
p-jackson authored Mar 17, 2021
1 parent 59f3e1a commit 6f8ff3f
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
// Always include these helper files for dotcom FSE.
require_once __DIR__ . '/dotcom-fse/helpers.php';

// Enqueues the shared JS data stores and defines shared helper functions.
require_once __DIR__ . '/common/index.php';

/**
* Load dotcom-FSE.
*/
Expand Down Expand Up @@ -139,14 +142,6 @@ function load_timeline_block() {
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_timeline_block' );

/**
* Load common module.
*/
function load_common_module() {
require_once __DIR__ . '/common/index.php';
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_common_module' );

/**
* Load Editor Site Launch.
*/
Expand Down

0 comments on commit 6f8ff3f

Please sign in to comment.