themeplate/enforcer

Simple enforcer of plugins per environment type

v1.0.0 2022-05-22 15:58 UTC

This package is auto-updated.

Last update: 2024-10-23 06:51:02 UTC


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' ) );