commit 8e496a9909d958a07cccf3082e6d708ca95f3d02 Author: Lewis Dale Date: Mon Jan 9 23:37:28 2023 +0000 Initial commit diff --git a/classes/init.php b/classes/init.php new file mode 100644 index 0000000..da0b331 --- /dev/null +++ b/classes/init.php @@ -0,0 +1,58 @@ +init(); + } + + public function init() { + add_action('admin_menu', array ( $this, 'submenu_page' )); + add_action('wp_print_styles', array( $this, 'enqueue_styles' ), 9999); + } + + public function enqueue_styles() { + global $wp_styles; + global $enqueued_styles; + $enqueued_styles = array(); + foreach( $wp_styles->queue as $handle ) { + $enqueued_styles[] = $wp_styles->registered[$handle]->src; + } + print_r($wp_styles->queue); + } + + public function submenu_page() { + add_menu_page( 'Lewtilities', 'Lewtilities', 'manage_options', 'lewtilities-main-menu', + array( $this, 'admin_styles' ), '', 84 ); + add_submenu_page( 'lewtilities-main-menu', __( 'Dashboard', 'wp-ld' ), + __( 'Dashboard', 'wp-ld' ), 'manage_options', + 'lewtilities-main-menu', array( $this, 'admin_styles' ) ); + } + + public function admin_settings() { + // echo "Settings!"; + } + + public function admin_styles() { + echo "Admin styles section"; + global $enqueued_styles; + echo var_dump($enqueued_styles); + } + + public function admin_options_page() { + add_menu_page( + 'Lewtilities', + 'Lewtilities', + 'manage_options', + 'lewtilities', + array( $this, 'admin_options_page_display' ) + ); + } + + public function admin_options_page_display() { + echo "Options page"; + } +} \ No newline at end of file diff --git a/lewtilities.php b/lewtilities.php new file mode 100644 index 0000000..538bef7 --- /dev/null +++ b/lewtilities.php @@ -0,0 +1,14 @@ +