-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-customizer.php
43 lines (40 loc) · 1.18 KB
/
theme-customizer.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
<?php
/**
* Plugin Name: Kunoichi Theme Customizer
* Plugin URI: https://github.com/kuno1/theme-customizer
* Description: Theme customizer helper
* Version: 0.0.0
* Author: Kunoichi INC.
* Author URI: https://kunoichiwp.com
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
* Text Domain: theme-customizer
* Domain Path: /languages
*/
// This file actually do nothing.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Invalid request.' );
}
require __DIR__ . '/vendor/autoload.php';
\Kunoichi\ThemeCustomizer::load_locale( get_locale() );
$auto_loaded = [
[ __DIR__ . '/src', 'Kunoichi/ThemeCustomizer/Patterns' ],
[ __DIR__ . '/tests/src/', 'Kunoichi/ThemeCustomizerTest' ],
];
foreach ( $auto_loaded as list( $base, $dir ) ) {
$path = $base . '/' . $dir;
if ( ! is_dir( $path ) ) {
continue;
}
foreach ( scandir( $path ) as $file ) {
if ( ! preg_match( '/^([^._].*)\.php$/u', $file, $match ) ) {
continue;
}
list( $file, $class_name ) = $match;
$class_name = str_replace( '/', '\\', $dir ) . '\\' . $class_name;
if ( ! class_exists( $class_name ) ) {
continue;
}
$class_name::get_instance();
}
}