Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Security */
- defined( 'ABSPATH' ) or die('Not so fast! Go back to where you came from, it\'s only downhill from here.');
- //this might be redundant
- if ( !function_exists( 'add_action' )){
- echo "No Go";
- exit;
- }
- /* End: Security */
- final class Init {
- private static function get_services()
- {
- return [
- cleanWP::class,
- adminPanel::class
- ];
- }
- public static function register_services()
- {
- require_once( get_stylesheet_directory() . '/inc/whiteLabel.php');
- require_once(get_stylesheet_directory() . '/inc/adminPanel.php');
- foreach ( self::get_services() as $class ) {
- $service = self::instantiate( $class );
- if ( method_exists( $service, 'register' ) ) {
- $service->register();
- }
- }
- }
- private static function instantiate( $class )
- {
- $service = new $class();
- return $service;
- }
- }
- if ( function_exists('add_action') && class_exists('Init')){
- global $wp_admin_bar;
- Init::register_services();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement