Skip to content

Commit

Permalink
Merge pull request #21 from newfold-labs/add/context-module
Browse files Browse the repository at this point in the history
Add/context module
  • Loading branch information
circlecube authored Feb 27, 2024
2 parents 5f12754 + f293082 commit a2bf4fd
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 26 deletions.
4 changes: 4 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\Module\Staging\Staging;
use function NewfoldLabs\WP\ModuleLoader\register;
use function NewfoldLabs\WP\Context\getContext;

if ( function_exists( 'add_action' ) ) {

Expand All @@ -15,6 +16,9 @@ function () {
'name' => 'staging',
'label' => __( 'Staging', 'newfold-staging-module' ),
'callback' => function ( Container $container ) {
if ( 'atomic' === getContext( 'platform' ) ) {
return;
}
return new Staging( $container );
},
'isActive' => true,
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
"newfold-labs/wp-module-context": "^1.0"
}
}
Loading

0 comments on commit a2bf4fd

Please sign in to comment.