Example #1
0
 function print_scripts()
 {
     if ($this->print_scripts_initialized == true) {
         return false;
     }
     $this->print_scripts_initialized = true;
     // Register & enqueue scripts
     op_enqueue_base_scripts();
     op_enqueue_backend_scripts();
     op_enqueue_fancybox_images();
     // Styles
     wp_enqueue_style(OP_SN . '-admin-assets', OP_CSS . 'assets' . OP_SCRIPT_DEBUG . '.css', array(OP_SN . '-admin-common'), OP_VERSION);
     wp_register_style(OP_SN . '-admin-common', OP_CSS . 'common' . OP_SCRIPT_DEBUG . '.css', array('farbtastic', 'thickbox'), OP_VERSION);
 }
Example #2
0
function op_init_page($id)
{
    global $wp_query;
    define('OP_PAGEBUILDER', true);
    define('OP_PAGEBUILDER_ID', $id);
    do_action('op_pre_init_page');
    require_once OP_ASSETS . 'live_editor.php';
    wp_enqueue_script('jquery', false, false, OP_VERSION);
    op_enqueue_base_scripts();
    // if (OP_SCRIPT_DEBUG === '') {
    //     //If jQuery version is higher than 1.9 we require jQuery migrate plugin (which is by default registered in WP versions that come with jQuery 1.9 or higher)
    //     if (wp_script_is('jquery-migrate', 'registered')) {
    //         wp_enqueue_script(OP_SN.'-noconflict-js', OP_JS.'jquery/jquery.noconflict'.OP_SCRIPT_DEBUG.'.js', array('jquery', 'jquery-migrate'), OP_VERSION);
    //     } else {
    //         wp_enqueue_script(OP_SN.'-noconflict-js', OP_JS.'jquery/jquery.noconflict'.OP_SCRIPT_DEBUG.'.js', array('jquery'), OP_VERSION);
    //     }
    //     wp_enqueue_script(OP_SN.'-loadScript', OP_JS.'jquery/jquery.loadScript'.OP_SCRIPT_DEBUG.'.js', array(OP_SN.'-noconflict-js'), OP_VERSION);
    // } else {
    //     if (wp_script_is('jquery-migrate', 'registered')) {
    //         wp_enqueue_script(OP_SN.'-op-jquery-base-all', OP_JS.'op-jquery-base-all.min.js', array('jquery', 'jquery-migrate'), OP_VERSION);
    //     } else {
    //         wp_enqueue_script(OP_SN.'-op-jquery-base-all', OP_JS.'op-jquery-base-all.min.js', array('jquery'), OP_VERSION);
    //     }
    // }
    op_init_page_theme();
    if (have_posts()) {
        the_post();
    }
    $GLOBALS['op_content_layout'] = op_page_layout('body', false, 'content_area', '');
    $GLOBALS['op_footer_layout'] = '';
    if (op_page_option('footer_area', 'enabled') == 'Y' && op_page_option('footer_area', 'large_footer', 'enabled') == 'Y') {
        $GLOBALS['op_footer_layout'] = op_page_layout('footer', false, 'footer_area');
    }
    do_action('op_after_init_page');
}
Example #3
0
/**
 * Enqueues social sharing element dependencies (necessery for plugin version)
 * @return void
 */
function op_sharrre_scripts()
{
    if (OP_SCRIPT_DEBUG === '') {
        wp_enqueue_script(OP_SN . '-selectnav', OP_JS . 'selectnav' . OP_SCRIPT_DEBUG . '.js', array(OP_SN . '-noconflict-js'), OP_VERSION);
        wp_enqueue_script(OP_SN . '-sharrre', OP_JS . 'jquery/jquery.sharrre-1.3.4.min.js', array(OP_SN . '-noconflict-js'), OP_VERSION);
        wp_enqueue_script(OP_SN . '-tooltipster', OP_JS . 'tooltipster.min.js', array(OP_SN . '-noconflict-js'), OP_VERSION);
        wp_enqueue_script(OP_SN . '-countdown', OP_JS . 'jquery/countdown' . OP_SCRIPT_DEBUG . '.js', array(OP_SN . '-noconflict-js'), OP_VERSION);
        wp_enqueue_script(OP_SN . '-global', OP_JS . 'global' . OP_SCRIPT_DEBUG . '.js', array(OP_SN . '-noconflict-js'), OP_VERSION);
    } else {
        op_enqueue_base_scripts();
        op_enqueue_frontend_scripts();
    }
}