PluginProbe
My WP Customize Admin/Frontend / trunk
My WP Customize Admin/Frontend vtrunk
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 trunk, at shortcode/shortcode.init.php

73 lines 1.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( 'MywpShortcodeInit' ) ) :
8
9 final class MywpShortcodeInit {
10
11 public static function init() {
12
13 add_action( 'mywp_plugins_loaded' , array( __CLASS__ , 'plugins_loaded_include_modules' ) , 20 );
14 add_action( 'mywp_after_setup_theme' , array( __CLASS__ , 'after_setup_theme_include_modules' ) , 20 );
15
16 add_action( 'mywp_init' , array( __CLASS__ , 'regist_shortcode' ) );
17
18 }
19
20 public static function plugins_loaded_include_modules() {
21
22 $dir = MYWP_PLUGIN_PATH . 'shortcode/modules/';
23
24 $includes = array(
25 'comment_count' => $dir . 'mywp.shortcode.module.comment_count.php',
26 'post' => $dir . 'mywp.shortcode.module.post.php',
27 'site' => $dir . 'mywp.shortcode.module.site.php',
28 'term' => $dir . 'mywp.shortcode.module.term.php',
29 'theme' => $dir . 'mywp.shortcode.module.theme.php',
30 'toolbar_item' => $dir . 'mywp.shortcode.module.toolbar_item.php',
31 'update_count' => $dir . 'mywp.shortcode.module.update_count.php',
32 'url' => $dir . 'mywp.shortcode.module.url.php',
33 'user' => $dir . 'mywp.shortcode.module.user.php',
34 );
35
36 $includes = apply_filters( 'mywp_shortcode_plugins_loaded_include_modules' , $includes );
37
38 MywpApi::require_files( $includes );
39
40 }
41
42 public static function after_setup_theme_include_modules() {
43
44 $includes = array();
45
46 $includes = apply_filters( 'mywp_shortcode_after_setup_theme_include_modules' , $includes );
47
48 MywpApi::require_files( $includes );
49
50 }
51
52 public static function regist_shortcode() {
53
54 $shortcodes = MywpShortcode::get_shortcodes();
55
56 if( empty( $shortcodes ) ) {
57
58 return false;
59
60 }
61
62 foreach( $shortcodes as $shotecode => $function ) {
63
64 add_shortcode( $shotecode , $function , 11 , 3 );
65
66 }
67
68 }
69
70 }
71
72 endif;
73