<?php 
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

function justiq_admin_css() {
	wp_enqueue_style( 'theme-default-font-admin', justiq_slug_fonts_url(), array(), null );
	wp_enqueue_style( 'justiq-admin', JUSTIQ_THEME_URL . '/assets/css/admin.css', array(), JUSTIQ_THEME_VERSION );	
	
	$documentation_link = apply_filters('justiq_documentation_link', true);

    if ($documentation_link) {
		wp_enqueue_script( 'justiq-admin-js', JUSTIQ_THEME_URL . '/assets/js/admin.js', array( 'jquery' ), JUSTIQ_THEME_VERSION, true );    
    }
	
}

// Hook the custom_admin_css function to the admin_enqueue_scripts action.
add_action('admin_enqueue_scripts', 'justiq_admin_css', 11);

add_action('admin_menu', 'justiq_custom_appearance_submenu');

function justiq_custom_appearance_submenu() {
	
    $documentation_link = apply_filters('justiq_documentation_link', true);

    if (!$documentation_link) {
        return;
    }
	
    add_submenu_page(
        'themes.php', 
        __( 'Documentation', 'justiq' ), 
        __( 'Documentation', 'justiq' ), 
        'manage_options', 
        'custom_documentation_link', 
        '__return_null' 
    );
}
