PluginProbe
My WP Customize Admin/Frontend / 1.3.2
My WP Customize Admin/Frontend v1.3.2
1.27.4 1.27.3 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.10 1.10.1 1.10.2 1.11 1.12 1.12.1 1.12.2 1.13 1.13.1 1.13.2 1.14 1.15.0 1.16 1.17.0 All 76 releases
my-wp / controller / controller.init.php

controller.init.php in My WP Customize Admin/Frontend 1.3.2, at controller/controller.init.php

130 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 if ( ! class_exists( 'MywpControllerInit' ) ) :
8
9 final class MywpControllerInit {
10
11 private static $instance;
12
13 private function __construct() {}
14
15 public static function get_instance() {
16
17 if ( !isset( self::$instance ) ) {
18
19 self::$instance = new self();
20
21 }
22
23 return self::$instance;
24
25 }
26
27 private function __clone() {}
28
29 private function __wakeup() {}
30
31 public static function init() {
32
33 add_action( 'mywp_plugins_loaded' , array( __CLASS__ , 'plugins_loaded_include_modules' ) , 20 );
34 add_action( 'mywp_after_setup_theme' , array( __CLASS__ , 'after_setup_theme_include_modules' ) , 20 );
35
36 add_action( 'mywp_request_admin' , array( __CLASS__ , 'controller_cache' ) );
37 add_action( 'mywp_request_frontend' , array( __CLASS__ , 'controller_cache' ) );
38
39 add_filter( 'mywp_debug_renders' , array( __CLASS__ , 'mywp_debug_renders' ) , 100 );
40
41 add_action( 'mywp_debug_render_controller' , array( __CLASS__ , 'mywp_debug_render_controller' ) );
42
43 }
44
45 public static function plugins_loaded_include_modules() {
46
47 $dir = MYWP_PLUGIN_PATH . 'controller/modules/';
48
49 $includes = array(
50 'admin_dashboard' => $dir . 'mywp.controller.module.admin.dashboard.php',
51 'admin_general' => $dir . 'mywp.controller.module.admin.general.php',
52 'admin_nav_menu' => $dir . 'mywp.controller.module.admin.nav-menu.php',
53 'admin_post_edit' => $dir . 'mywp.controller.module.admin.post.edit.php',
54 'admin_posts' => $dir . 'mywp.controller.module.admin.posts.php',
55 'admin_regist_metaboxes' => $dir . 'mywp.controller.module.admin.regist.metaboxes.php',
56 'admin_sidebar' => $dir . 'mywp.controller.module.admin.sidebar.php',
57 'admin_user_edit' => $dir . 'mywp.controller.module.admin.user-edit.php',
58 'debug_general' => $dir . 'mywp.controller.module.debug.general.php',
59 'frontend_author_archive' => $dir . 'mywp.controller.module.frontend.author-archive.php',
60 'frontend_date_archive' => $dir . 'mywp.controller.module.frontend.date-archive.php',
61 'frontend_taxonomy_archive' => $dir . 'mywp.controller.module.frontend.taxonomy-archive.php',
62 'frontend_general' => $dir . 'mywp.controller.module.frontend.general.php',
63 'main_general' => $dir . 'mywp.controller.module.main.general.php',
64 'site_general' => $dir . 'mywp.controller.module.site.general.php',
65 'site_post_type' => $dir . 'mywp.controller.module.site.post-type.php',
66 );
67
68 $includes = apply_filters( 'mywp_controller_plugins_loaded_include_modules' , $includes );
69
70 MywpApi::require_files( $includes );
71
72 }
73
74 public static function after_setup_theme_include_modules() {
75
76 $includes = array();
77
78 $includes = apply_filters( 'mywp_controller_after_setup_theme_include_modules' , $includes );
79
80 MywpApi::require_files( $includes );
81
82 }
83
84 public static function controller_cache() {
85
86 MywpController::set_controllers();
87
88 }
89
90 public static function mywp_debug_renders( $debug_renders ) {
91
92 $debug_renders['controller'] = array(
93 'debug_type' => 'mywp',
94 'title' => __( 'Controller' , 'mywp' ),
95 );
96
97 return $debug_renders;
98
99 }
100
101 public static function mywp_debug_render_controller() {
102
103 echo '<ul>';
104
105 $controllers = MywpController::get_controllers();
106
107 if( !empty( $controllers ) ) {
108
109 foreach( $controllers as $controller_id => $controller ) {
110
111 if( !empty( $controller['model'] ) && is_object( $controller['model'] ) ) {
112
113 $controller['model']->get_data();
114
115 }
116
117 printf( '<li>%s <textarea readonly="readonly">%s</textarea></li>' , $controller_id , print_r( $controller , true ) );
118
119 }
120
121 }
122
123 echo '</ul>';
124
125 }
126
127 }
128
129 endif;
130