From b18f1c46b4aef28be8ec81525b228f9ef89f6662 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Fri, 18 Apr 2025 18:29:11 +0100 Subject: [PATCH] Feat: Implement Admin class structure and instantiate in Plugin --- includes/Admin/Admin.php | 50 +++++++++++++++++++++++++++++++++++++++ includes/class-plugin.php | 10 ++++++++ 2 files changed, 60 insertions(+) create mode 100644 includes/Admin/Admin.php diff --git a/includes/Admin/Admin.php b/includes/Admin/Admin.php new file mode 100644 index 0000000..c0452c1 --- /dev/null +++ b/includes/Admin/Admin.php @@ -0,0 +1,50 @@ +core = $core; + $this->initialize_hooks(); + } + + /** + * Initializes WordPress hooks. + */ + private function initialize_hooks() { + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_assets' ] ); + } + + /** + * Enqueues admin-specific assets. + * + * @param string $hook_suffix The current admin page. + */ + public function enqueue_admin_assets( $hook_suffix ) { + // Admin assets enqueue logic will go here. + // The test mocks wp_enqueue_style, wp_enqueue_script, etc. + } +} diff --git a/includes/class-plugin.php b/includes/class-plugin.php index fcc6a07..f2400d5 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -7,6 +7,8 @@ namespace WPALLSTARS\PluginStarterTemplate; +use WPALLSTARS\PluginStarterTemplate\Admin\Admin; + /** * Plugin class */ @@ -19,6 +21,13 @@ class Plugin { */ private $core; + /** + * Admin instance + * + * @var Admin + */ + private $admin; + /** * Plugin file * @@ -43,6 +52,7 @@ class Plugin { $this->plugin_file = $plugin_file; $this->version = $version; $this->core = new Core(); + $this->admin = new Admin( $this->core ); } /**