at path:
ROOT
/
wp-content
/
themes
/
tutorstarter
/
inc
/
Init.php
run:
R
W
Run
Api
DIR
2026-07-10 16:52:19
R
W
Run
Core
DIR
2026-07-10 16:52:19
R
W
Run
Custom
DIR
2026-07-10 16:52:19
R
W
Run
Setup
DIR
2026-07-10 16:52:19
R
W
Run
Traits
DIR
2026-07-10 16:52:19
R
W
Run
Helpers.php
22.45 KB
2026-07-08 13:33:50
R
W
Run
Delete
Rename
Init.php
1.3 KB
2026-07-08 13:33:50
R
W
Run
Delete
Rename
error_log
up
📄
Init.php
Save
<?php /** * Handles all the classes initilization * * @package Tutor_Starter */ namespace Tutor_Starter; defined( 'ABSPATH' ) || exit; /** * Init class * * @package Tutor_Starter */ final class Init { /** * Store all the classes inside an array * * @return array Full list of classes */ public static function get_services() { return array( Core\Tags::class, Setup\Setup::class, Setup\Menus::class, Core\Sidebar::class, Custom\Extras::class, Custom\Block_Extras::class, Setup\Enqueue::class, Setup\Dashboard::class, Custom\Schema\Schema::class, Custom\Component_Handler::class, Custom\Page\Page_Settings::class, Api\Customizer\Customizer::class, Custom\Schema\Custom_Metabox::class, ); } /** * Loop through the classes, initialize them, and call the register() method if it exists * * @return void */ public static function register_services() { foreach ( self::get_services() as $class ) { $service = self::instantiate( $class ); if ( method_exists( $service, 'register' ) ) { $service->register(); } } } /** * Initialize the class * * @param class $class class from the services array. * @return class instance new instance of the class */ private static function instantiate( $class ) { return new $class(); } }