PluginProbe
My WP Customize Admin/Frontend / 1.6.2
My WP Customize Admin/Frontend v1.6.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 / shortcode / shortcode.init.php

shortcode.init.php in My WP Customize Admin/Frontend 1.6.2, at shortcode/shortcode.init.php

90 lines 1.9 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( 'MywpShortcodeInit' ) ) :
8
9 final class MywpShortcodeInit {
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_init' , array( __CLASS__ , 'regist_shortcode' ) );
37
38 }
39
40 public static function plugins_loaded_include_modules() {
41
42 $dir = MYWP_PLUGIN_PATH . 'shortcode/modules/';
43
44 $includes = array(
45 'comment_count' => $dir . 'mywp.shortcode.module.comment_count.php',
46 'site' => $dir . 'mywp.shortcode.module.site.php',
47 'theme' => $dir . 'mywp.shortcode.module.theme.php',
48 'update_count' => $dir . 'mywp.shortcode.module.update_count.php',
49 'url' => $dir . 'mywp.shortcode.module.url.php',
50 'user' => $dir . 'mywp.shortcode.module.user.php',
51 );
52
53 $includes = apply_filters( 'mywp_shortcode_plugins_loaded_include_modules' , $includes );
54
55 MywpApi::require_files( $includes );
56
57 }
58
59 public static function after_setup_theme_include_modules() {
60
61 $includes = array();
62
63 $includes = apply_filters( 'mywp_shortcode_after_setup_theme_include_modules' , $includes );
64
65 MywpApi::require_files( $includes );
66
67 }
68
69 public static function regist_shortcode() {
70
71 $shortcodes = MywpShortcode::get_shortcodes();
72
73 if( empty( $shortcodes ) ) {
74
75 return false;
76
77 }
78
79 foreach( $shortcodes as $shotecode => $function ) {
80
81 add_shortcode( $shotecode , $function , 11 , 3 );
82
83 }
84
85 }
86
87 }
88
89 endif;
90