Skip to content

Commit

Permalink
set context adjusted after context is set
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Feb 22, 2024
1 parent b6df838 commit 5e592d7
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e592d7

Please sign in to comment.