Initialized repo
This commit is contained in:
43
includes/Plugin.php
Normal file
43
includes/Plugin.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Main Plugin class for Theme Style Darkmode.
|
||||
* Handles initialization and hooks registration.
|
||||
*/
|
||||
|
||||
namespace LasLie\ThemeStyleDarkmode;
|
||||
|
||||
class Plugin {
|
||||
/**
|
||||
* Initialize the plugin by registering hooks.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void {
|
||||
add_action( 'plugins_loaded', [ $this, 'load_files' ] );
|
||||
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all plugin files systematically.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function load_files(): void {
|
||||
require_once Config::PATH . 'includes/Functions.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue plugin scripts and styles.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue_scripts(): void {
|
||||
wp_enqueue_script(
|
||||
'll-tsd-auto-style-switch',
|
||||
Config::URL . 'assets/js/auto-style-switch.js',
|
||||
[],
|
||||
Config::VERSION,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user