forked from darrenjacoby/intervention
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintervention.php
36 lines (33 loc) · 1017 Bytes
/
intervention.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
Plugin Name: Intervention
Plugin URI: http://github.com/soberwp/intervention
Description: WordPress plugin containing modules to cleanup and customize wp-admin
Version: 1.1.1
Author: Sober
Author URI: http://github.com/soberwp/
License: MIT License
License URI: http://opensource.org/licenses/MIT
GitHub Plugin URI: soberwp/intervention
GitHub Branch: master
*/
namespace Sober\Intervention;
/**
* Plugin
*/
if (!defined('ABSPATH')) {
die;
};
require(file_exists($composer = __DIR__ . '/vendor/autoload.php') ? $composer : __DIR__ . '/dist/autoload.php');
/**
* Setup $loader object from function intervention
*
* @param string $module
* @param string|array $config
* @param string|array $roles
*/
function intervention($module = false, $config = false, $roles = false)
{
$class = __NAMESPACE__ . '\Module\\' . str_replace('-', '', ucwords($module, '-'));
$instance = (new $class($config, $roles))->run();
}