refactor: create Admin Manager class and move menu registration
This commit is contained in:
35
admin/includes/class-admin-manager.php
Normal file
35
admin/includes/class-admin-manager.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* WP ALLSTARS Admin Manager
|
||||
*
|
||||
* Handles admin-related functionality including menu registration,
|
||||
* script enqueueing, and admin page rendering.
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class WP_Allstars_Admin_Manager {
|
||||
|
||||
/**
|
||||
* Initialize the class
|
||||
*/
|
||||
public static function init() {
|
||||
// Register hooks - we'll add more as we refactor each function
|
||||
add_action('admin_menu', array(__CLASS__, 'register_admin_menu'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the admin menu item
|
||||
*/
|
||||
public static function register_admin_menu() {
|
||||
add_options_page(
|
||||
'WP ALLSTARS Settings',
|
||||
'WP ALLSTARS',
|
||||
'manage_options',
|
||||
'wp-allstars',
|
||||
'wp_allstars_settings_page'
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user