Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[J#BWP-39][CONFIG] Initialise flagpole earlier. #339

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions wp-content/mu-plugins/000-boxuk-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,26 @@ static function() {
}
);

/**
* Register feature flags if we have a flags.yaml set.
*/
$plugin_active = boxuk_container()->has( 'BoxUk\Plugins\Base\FeatureFlag\FeatureFlagManager' );
if ( $plugin_active === true && file_exists( __DIR__ . '/000-boxuk/flags.yaml' ) ) {
/**
* IDE hint.
*
* @var FeatureFlagManager $feature_flag_manager
*/
$feature_flag_manager = boxuk_container()->get( 'BoxUk\Plugins\Base\FeatureFlag\FeatureFlagManager' );
$feature_flag_manager->register_from_yaml_file( __DIR__ . '/000-boxuk/flags.yaml' );
}

/**
* Things to do by default once all plugins have been loaded.
*/
add_action(
'plugins_loaded',
static function() {
// Register feature flags if we have a flags.yaml set.
$plugin_active = boxuk_container()->has( 'BoxUk\Plugins\Base\FeatureFlag\FeatureFlagManager' );
if ( $plugin_active === true && file_exists( __DIR__ . '/000-boxuk/flags.yaml' ) ) {
/**
* IDE hint.
*
* @var FeatureFlagManager $feature_flag_manager
*/
$feature_flag_manager = boxuk_container()->get( 'BoxUk\Plugins\Base\FeatureFlag\FeatureFlagManager' );
$feature_flag_manager->register_from_yaml_file( __DIR__ . '/000-boxuk/flags.yaml' );
}

$locale = get_locale();
load_textdomain( PROJECT_NAME, WP_LANG_DIR . '/' . PROJECT_NAME . '-' . $locale . '.mo' );
}
Expand Down