-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathintervention.php
More file actions
72 lines (59 loc) · 1.56 KB
/
Copy pathintervention.php
File metadata and controls
72 lines (59 loc) · 1.56 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/*
Plugin Name: Intervention
Plugin URI: https://github.com/darrenjacoby/intervention
Description: Easily customize wp-admin and configure application options.
Text Domain: intervention
Version: 2.0.0
Author: Darren Jacoby
Author URI: https://github.com/darrenjacoby
License: MIT License
License URI: https://opensource.org/licenses/MIT
*/
namespace Jacoby\Intervention;
use Jacoby\Intervention\Intervention;
/**
* Restrict direct access
*/
if (!defined('ABSPATH')) {
die;
}
define('INTERVENTION_DIR', dirname(__FILE__));
define('THEME_TEXT_DOMAIN', wp_get_theme()->get('TextDomain'));
define('INTERVENTION_TEXT_DOMAIN', 'intervention');
/**
* Support for Bedrock/Composer
*/
if (is_file(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
// include file_exists($composer = __DIR__ . '/vendor/autoload.php') ? $composer : __DIR__ . '/build/vendor/autoload.php';
/**
* WordPress/Laravel mix function
*/
include __DIR__ . '/mix.php';
/**
* Return user config for Intervention
*
* @return array
*/
function getConfigFile()
{
$theme = get_stylesheet_directory();
$default = file_exists($theme . '/config/') ?
$theme . '/config/intervention.php' :
$theme . '/intervention.php';
$config = has_filter('sober/intervention/return') ?
apply_filters('sober/intervention/return', rtrim($default)) :
$default;
if (!file_exists($config)) {
return;
}
$read = include $config;
return $read === 1 ? false : $read;
}
/**
* Initialize
*/
new Intervention(getConfigFile());
new UserInterface();