setup_hooks(); } private function setup_hooks() { add_action( 'admin_menu', array( $this, 'create_menu' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); } public function enqueue_scripts() { wp_enqueue_style( 'colormag-admin-dashboard', get_template_directory_uri() . '/inc/admin/css/admin.css' ); } public function create_menu() { if ( is_child_theme() ) { $theme = wp_get_theme()->parent(); } else { $theme = wp_get_theme(); } /* translators: %s: Theme Name. */ $theme_page_name = sprintf( esc_html__( '%s Options', 'colormag' ), $theme->Name ); $page = add_theme_page( $theme_page_name, $theme_page_name, 'edit_theme_options', 'colormag-options', array( $this, 'option_page' ) ); add_action( 'admin_print_styles-' . $page, array( $this, 'enqueue_styles' ) ); } public function enqueue_styles() { wp_enqueue_style( 'colormag-dashboard', get_template_directory_uri() . '/inc/admin/css/admin.css', array(), COLORMAG_THEME_VERSION ); } public function option_page() { if ( is_child_theme() ) { $theme = wp_get_theme()->parent(); } else { $theme = wp_get_theme(); } ?>
Name ); ?>