44 lines
977 B
PHP
44 lines
977 B
PHP
<?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
|
|
);
|
|
}
|
|
}
|