From 5e592d719106e6279cad8745878bd2aee7baabae Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 22 Feb 2024 17:41:32 -0500 Subject: [PATCH] set context adjusted after context is set --- bootstrap.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 8f8bdfc83..f3f5d2262 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -63,17 +63,26 @@ function () { ) ); -// Set performance settings -$cache_types = array( 'browser', 'skip404' ); -if ( 'atomic' === getContext( 'platform' ) ) { - $cache_types = array(); -} -$bluehost_module_container->set( 'cache_types', $cache_types ); +// Assign container values based on context +add_action( + 'plugins_loaded', + function () { + global $bluehost_module_container; + + // Performance default settings + $cache_types = array( 'browser', 'skip404' ); + // Marketplace default settings + $marketplace_brand = 'bluehost'; + + // Platform overrides + if ( 'atomic' === getContext( 'platform' ) ) { + $cache_types = array(); + $marketplace_brand = 'bluehost-cloud'; + } -// Marketplace settings -$bluehost_module_container->set( - 'marketplace_brand', - 'atomic' !== getContext( 'platform' ) ? 'bluehost' : 'bluehost-cloud' + $bluehost_module_container->set( 'cache_types', $cache_types ); + $bluehost_module_container->set( 'marketplace_brand', $marketplace_brand ); + } ); // Properly get branding links depending on market