-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions.php
115 lines (86 loc) · 2.68 KB
/
functions.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
/**
* @package Arkhe
* @author LOOS,Inc.
* @link https://arkhe-theme.com/
*/
/**
* パス・URIの定数化
*/
define( 'ARKHE_THEME_PATH', get_template_directory() );
define( 'ARKHE_THEME_URI', get_template_directory_uri() );
// 子テーマ用のパス, URI
if ( ! defined( 'ARKHE_CHILD_PATH' ) ) {
define( 'ARKHE_CHILD_PATH', get_stylesheet_directory() );
}
if ( ! defined( 'ARKHE_CHILD_URI' ) ) {
define( 'ARKHE_CHILD_URI', get_stylesheet_directory_uri() );
}
/**
* CLASSのオートロード
*/
spl_autoload_register(
function( $classname ) {
// 名前に Arkhe_Theme がなければオートロードしない。
if ( strpos( $classname, 'Arkhe_Theme' ) === false ) return;
$classname = str_replace( '\\', '/', $classname );
$classname = str_replace( 'Arkhe_Theme/', '', $classname );
$file = ARKHE_THEME_PATH . '/classes/' . $classname . '.php';
if ( file_exists( $file ) ) require $file;
}
);
/**
* Arkhe_Theme
*/
class Arkhe extends \Arkhe_Theme\Data {
use \Arkhe_Theme\Utility\Attrs;
use \Arkhe_Theme\Utility\Get;
use \Arkhe_Theme\Utility\SVG;
use \Arkhe_Theme\Utility\Image;
use \Arkhe_Theme\Utility\Parts;
use \Arkhe_Theme\Utility\Output;
use \Arkhe_Theme\Utility\Licence;
use \Arkhe_Theme\Utility\Condition;
public function __construct() {
// Data::init データをセット
self::init();
// 定数定義
require_once ARKHE_THEME_PATH . '/inc/consts.php';
// テーマサポート機能
require_once ARKHE_THEME_PATH . '/inc/theme_support.php';
// ファイル読み込み
require_once ARKHE_THEME_PATH . '/inc/enqueue_scripts.php';
// カスタマイザー
require_once ARKHE_THEME_PATH . '/inc/customizer.php';
// カスタムメニュー
require_once ARKHE_THEME_PATH . '/inc/custom_menu.php';
// ウィジェット
require_once ARKHE_THEME_PATH . '/inc/widget.php';
// Gutenberg
require_once ARKHE_THEME_PATH . '/inc/gutenberg.php';
// クラシックエディター
require_once ARKHE_THEME_PATH . '/inc/tinymce.php';
// プラガブル関数
require_once ARKHE_THEME_PATH . '/inc/pluggable.php';
// 出力処理
require_once ARKHE_THEME_PATH . '/inc/output.php';
// その他、フック処理
require_once ARKHE_THEME_PATH . '/inc/hooks.php';
// 後方互換用関数
require_once ARKHE_THEME_PATH . '/inc/backward.php';
if ( is_admin() ) {
// Notice
require_once ARKHE_THEME_PATH . '/inc/notice.php';
// テーマページ
require_once ARKHE_THEME_PATH . '/inc/theme_menu.php';
}
// アップデート時の処理
if ( is_admin() || is_user_logged_in() ) {
require_once ARKHE_THEME_PATH . '/inc/update.php';
}
}
}
/**
* Start!
*/
new \Arkhe();