lewtilities/classes/init.php
2023-01-09 23:37:28 +00:00

58 lines
1.3 KiB
PHP

<?php
global $enqueued_scripts;
class Lewtilities {
public function __construct()
{
$this->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";
}
}