PluginProbe
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch / 2.1.1
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch v2.1.1
2.1.1 2.1.0 trunk 1.0 1.1 1.2 1.4.2 1.5.2 1.5.5 1.6.1 1.6.2 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
yt-player / inc / Init.php

Init.php in Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch 2.1.1, at inc/Init.php

51 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound
3 namespace YTP;
4
5
6 class Init{
7
8 public static function get_services(){
9 return [
10 Page\Dashboard::class,
11 PostType\YTPlayer::class,
12 Base\Initialize::class,
13 Page\Settings::class,
14 Services\Shortcode::class,
15 Services\CommonShortcode::class,
16 Services\EnqueueAssets::class,
17 Base\EnqueueAssets::class,
18 Model\Ajax::class,
19 Database\Init::class,
20 Base\Presets::class,
21 ];
22 }
23
24 private static $registered = false;
25
26 public static function register_services(){
27 if (self::$registered) {
28 return;
29 }
30 self::$registered = true;
31
32 foreach(self::get_services() as $class){
33 $services = self::instantiate($class);
34 if(method_exists($services, 'register')){
35 $services->register();
36 }
37 }
38
39 }
40
41 private static function instantiate($class){
42 if(class_exists($class)){
43 return new $class();
44 }
45
46 return new \stdClass();
47 }
48 }
49
50
51