themeplate / enforcer
Simple enforcer of plugins per environment type
v1.0.0
2022-05-22 15:58 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- themeplate/tester: ^1.3
README
Usage
use ThemePlate\Enforcer; $enforcer = new Enforcer(); $enforcer->register( 'local', 'query-monitor/query-monitor.php' ); $enforcer->register( 'production', 'wordfence/wordfence.php' ); // or register all in one go $plugins = array( 'local' => array( 'query-monitor/query-monitor.php', ), 'production' => array( 'wordfence/wordfence.php', ), ); $enforcer->load( $plugins ); // set up the hooks add_action( 'init', array( $enforcer, 'init' ) );