markdown_doc_url = $markdown_doc_url; if ( is_admin() || is_customize_preview() ) { add_action( 'admin_enqueue_scripts', array( $this, 'huh_load_scripts' ) ); add_action( 'admin_footer', array( $this, 'display_huh' ) ); } } /** * Enqueue CSS and JS. */ public function huh_load_scripts() { wp_register_style( 'huh_admin_css', get_theme_file_uri().'/lib/huh/huh.css', false ); wp_enqueue_style( 'huh_admin_css' ); wp_register_script( 'huh_admin_js', get_theme_file_uri().'/lib/huh/js/huh.js', false ); wp_enqueue_script( 'huh_admin_js' ); wp_register_script( 'huh_markdown_js', get_theme_file_uri().'/lib/huh/js/marked.js', false ); wp_enqueue_script( 'huh_markdown_js' ); } /** * Get admin color scheme. */ public function huh_get_admin_colors() { global $_wp_admin_css_colors; $current_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true ); $colors = $_wp_admin_css_colors[ $current_color_scheme ]->colors; return $colors; } /** * Display the HTML. * @param $markdown_doc_url URL of the raw markdown file. */ public function display_huh() { $colors = $this->huh_get_admin_colors(); $huh_accent_color = $colors[1]; ?>