/**
 * PageLines <head> Includes
 *
 */
function pagelines_head_common()
{
    global $pagelines_ID;
    $oset = array('post_id' => $pagelines_ID);
    pagelines_register_hook('pagelines_code_before_head');
    // Hook
    //pagelines_source_attribution();
    // Allow for extension deactivation of all css
    if (!has_action('override_pagelines_css_output')) {
        // Multisite CSS
        if (is_multisite()) {
            pagelines_load_css_relative('css/multisite.css', 'pagelines-multisite');
        }
        // Allow for PHP include of Framework CSS
        //		if( !apply_filters( 'disable_pl_framework_css', '' ) )
        //			pagelines_load_css(  PL_PARENT_URL.'/style.css', 'pagelines-framework', pagelines_get_style_ver( true ));
        // RTL Language Support
        // wordpress autoloads from child theme so if child theme has no rtl we need to load ours.
        if (is_rtl() && is_child_theme() && !is_file(sprintf('%s/rtl.css', get_stylesheet_directory())) || is_rtl() && !is_child_theme()) {
            add_action('wp_print_styles', create_function('', 'pagelines_load_css_relative( "rtl.css", "pagelines-rtl" );'), 99);
        }
    }
    if (ploption('facebook_headers') && !has_action('disable_facebook_headers') && VPRO) {
        pagelines_facebook_header();
    }
    // Fix IE and special handling
    if (pl_detect_ie()) {
        pagelines_fix_ie();
    }
    // Cufon replacement
    pagelines_font_replacement();
    if (ploption('load_prettify_libs')) {
        load_prettify();
    }
    add_action('wp_head', create_function('', 'echo pl_source_comment("Start >> Meta Tags and Inline Scripts", 2);'), 0);
    add_action('wp_print_styles', create_function('', 'echo pl_source_comment("Styles");'), 0);
    add_action('wp_print_scripts', create_function('', 'echo pl_source_comment("Scripts");'), 0);
    add_action('wp_print_footer_scripts', create_function('', 'echo pl_source_comment("Footer Scripts");'), 0);
    add_action('admin_bar_menu', create_function('', 'echo pl_source_comment("WordPress Admin Bar");'), 0);
    add_action('wp_head', 'pagelines_meta_tags', 9);
    add_action('wp_head', 'pl_scripts_on_ready', 10);
    // Headerscripts option > custom code
    if (ploption('headerscripts')) {
        add_action('wp_head', create_function('', 'print_pagelines_option("headerscripts");'), 25);
    }
    if (ploption('asynch_analytics')) {
        add_action('pagelines_head_last', create_function('', 'echo ploption("asynch_analytics");'), 25);
    }
}
Beispiel #2
0
function pagelines_head_common()
{
    global $pagelines_ID;
    $oset = array('post_id' => $pagelines_ID);
    pagelines_register_hook('pagelines_code_before_head');
    // Hook
    printf('<meta http-equiv="Content-Type" content="%s; charset=%s" />', get_bloginfo('html_type'), get_bloginfo('charset'));
    pagelines_source_attribution();
    // // Auto handle wp_title, added in WP 4.1
    if (!function_exists('_wp_render_title_tag')) {
        printf('<title>%s</title>', wp_title('', false));
    }
    // Allow for extension deactivation of all css
    if (!has_action('override_pagelines_css_output')) {
        // RTL Language Support
        // wordpress autoloads from child theme so if child theme has no rtl we need to load ours.
        if (is_rtl() && is_child_theme() && !is_file(sprintf('%s/rtl.css', get_stylesheet_directory())) || is_rtl() && !is_child_theme()) {
            add_action('wp_print_styles', create_function('', 'pagelines_load_css_relative( "rtl.css", "pagelines-rtl" );'), 99);
        }
    }
    if (pl_setting('facebook_headers') && !has_action('disable_facebook_headers') && VPRO) {
        pagelines_facebook_header();
    }
    if (pl_setting('load_prettify_libs')) {
        pagelines_add_bodyclass('prettify-on');
        wp_enqueue_script('prettify', PL_JS . '/prettify/prettify.min.js');
        wp_enqueue_style('prettify', PL_JS . '/prettify/prettify.css');
        add_action('wp_head', create_function('', 'echo pl_js_wrap("prettyPrint()");'), 14);
    }
    add_action('wp_head', create_function('', 'echo pl_source_comment("Start >> Meta Tags and Inline Scripts", 2);'), 0);
    add_action('wp_print_styles', create_function('', 'echo pl_source_comment("Styles");'), 0);
    add_action('wp_print_scripts', create_function('', 'echo pl_source_comment("Scripts");'), 0);
    add_action('wp_print_footer_scripts', create_function('', 'echo pl_source_comment("Footer Scripts");'), 0);
    add_action('admin_bar_menu', create_function('', 'echo pl_source_comment("WordPress Admin Bar");'), 0);
    add_action('wp_head', 'pagelines_meta_tags', 9);
    add_action('wp_head', 'pl_scripts_on_ready', 10);
    // Headerscripts option > custom code
    if (pl_setting('headerscripts') && pl_setting('headerscripts') != default_headerscript()) {
        add_action('wp_head', create_function('', 'print_pagelines_option("headerscripts");'), 25);
    }
    if (pl_setting('asynch_analytics')) {
        add_action('pagelines_head_last', create_function('', 'echo pl_setting("asynch_analytics");'), 25);
    }
}