forked from brentjett/bb-experiments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb-experiments.php
54 lines (48 loc) · 1.59 KB
/
bb-experiments.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*
Plugin Name: Beaver Builder Experiments
Version: 0.2
Description: A set of scratchwork and experiments for extending Beaver Builder.
Author: Brent Jett
Author URI: http://brentjett.design
*/
define( 'BB_EXPERIMENTS_DIR', plugin_dir_path( __FILE__ ) );
// Optionally Include Projects
function brj_include_experiments() {
$experiments = array(
array(
'key' => 'bb-minimap',
'label' => 'Beaver Builder Minimap',
'include' => BB_EXPERIMENTS_DIR . '/bb-minimap/bb-minimap.php'
),
array(
'key' => 'bb-store-kit',
'label' => 'Beaver Builder Store Kit',
'include' => BB_EXPERIMENTS_DIR . '/bb-store-kit/bb-store-kit.php'
),
array(
'key' => 'bb-tutorials',
'label' => 'Beaver Builder Tutorials Plugin Base',
'include' => BB_EXPERIMENTS_DIR . '/bb-tutorials/bb-tutorials.php'
),
array(
'key' => 'bb-ui-themes',
'label' => 'Beaver Builder UI Themes',
'include' => BB_EXPERIMENTS_DIR . '/bb-ui-themes/bb-ui-themes.php'
)
);
if (!empty($experiments)) {
foreach($experiments as $proj) {
if ( apply_filters('brj/include_experiment', true, $proj['key']) ) {
require_once $proj['include'];
}
}
}
}
add_action('plugins_loaded', 'brj_include_experiments');
function brj_check_include_experiment($bool = true, $key) {
// @todo: Add UI Check Here
return $bool;
}
add_filter('brj/include_experiment', 'brj_check_include_experiment', 10, 2);
?>