Beispiel #1
0
function enlightenment_menu_icons_enqueue_scripts($hook_suffix)
{
    if ('nav-menus.php' == $hook_suffix) {
        wp_enqueue_style('glyphicons', enlightenment_styles_directory_uri() . '/glyphicons.min.css', false, null);
        wp_enqueue_style('enlightenment-menu-icons', enlightenment_styles_directory_uri() . '/menu-icons.css', false, null);
        wp_enqueue_script('enlightenment-menu-icons', enlightenment_scripts_directory_uri() . '/menu-icons.js', array('jquery'), null);
    }
}
Beispiel #2
0
function enlightenment_theme_options_scripts($page_hook)
{
    if ('appearance_page_' . current_theme_supports('enlightenment-theme-settings', 'menu_slug') == $page_hook || 'post.php' == $page_hook) {
        wp_enqueue_style('enlightenment_theme_options_style', enlightenment_styles_directory_uri() . '/settings.css');
    }
    wp_enqueue_script('enlightenment_theme_options_script', enlightenment_scripts_directory_uri() . '/settings.js');
    $args = apply_filters('enlightenment_settings_args', array());
    if (!empty($args)) {
        wp_localize_script('enlightenment_theme_options_script', 'enlightenment_settings_args', $args);
    }
    if (current_theme_supports('enlightenment-custom-layouts') && ('post.php' == $page_hook || 'post-new.php' == $page_hook)) {
        wp_enqueue_style('enlightenment_edit_post_style', enlightenment_styles_directory_uri() . '/edit-post.css');
        wp_enqueue_script('enlightenment_edit_post_script', enlightenment_scripts_directory_uri() . '/edit-post.js');
    }
}
Beispiel #3
0
function enlightenment_theme_options_scripts($page_hook)
{
    if ('appearance_page_' . current_theme_supports('enlightenment-theme-settings', 'menu_slug') == $page_hook || 'post.php' == $page_hook) {
        wp_enqueue_style('enlightenment_theme_options_style', enlightenment_styles_directory_uri() . '/settings.css');
    }
    wp_enqueue_script('enlightenment_theme_options_script', enlightenment_scripts_directory_uri() . '/settings.js');
    $tabs = enlightenment_theme_options_page_tabs();
    $args = apply_filters('enlightenment_settings_args', array('admin_url' => admin_url(), 'menu_slug' => current_theme_supports('enlightenment-theme-settings', 'menu_slug'), 'current_tab' => isset($_GET['tab']) ? esc_attr($_GET['tab']) : key($tabs)));
    if (!empty($args)) {
        wp_localize_script('enlightenment_theme_options_script', 'enlightenment_settings_args', $args);
    }
    if (current_theme_supports('enlightenment-custom-layouts') && ('post.php' == $page_hook || 'post-new.php' == $page_hook)) {
        wp_enqueue_style('enlightenment_edit_post_style', enlightenment_styles_directory_uri() . '/edit-post.css');
        wp_enqueue_script('enlightenment_edit_post_script', enlightenment_scripts_directory_uri() . '/edit-post.js');
    }
}
Beispiel #4
0
function enlightenment_ie_shim($args = null)
{
    $defaults = array('conditional' => 'lt IE 9', 'html5shiv' => true, 'respond.js' => true, 'echo' => true);
    $defaults = apply_filters('enlightenment_ie_shim_args', $defaults);
    $args = wp_parse_args($args, $defaults);
    $output = '';
    if ($args['html5shiv'] || $args['respond.js']) {
        $output .= sprintf("<!--[if %s]>\n", esc_attr($args['conditional']));
        if ($args['html5shiv']) {
            $output .= sprintf("<script src='%s'></script>\n", esc_url(enlightenment_scripts_directory_uri() . '/html5shiv.min.js'));
        }
        if ($args['respond.js']) {
            $output .= sprintf("<script src='%s'></script>\n", esc_url(enlightenment_scripts_directory_uri() . '/respond.min.js'));
        }
        $output .= "<![endif]-->\n";
    }
    $output = apply_filters('enlightenment_ie_shim', $output, $args);
    if (!$args['echo']) {
        return $output;
    }
    echo $output;
}