示例#1
0
 function theme_change()
 {
     $this->get_step();
     $reinit_page_theme = false;
     if (isset($_GET['page_id'])) {
         $cur_page = op_page_option('theme', 'dir');
         if (isset($_GET['page_id']) && isset($_GET['theme_switch']) && $_GET['theme_switch'] != $cur_page && ($conf = op_load_page_config($_GET['theme_switch'])) !== false) {
             $theme = array('name' => $conf['name'], 'screenshot' => $conf['screenshot'], 'screenshot_thumbnail' => $conf['screenshot_thumbnail'], 'description' => $conf['description'], 'dir' => $_GET['theme_switch']);
             op_update_page_option('theme', $theme);
             $reinit_page_theme = true;
         }
     }
     define('OP_REINIT_PAGE_THEME', $reinit_page_theme);
     if ($reinit_page_theme) {
         define('OP_SHOW_THEME_MSG', $cur_page !== false);
     }
     if (defined('OP_PAGEBUILDER_ID')) {
         op_init_page_theme();
         if (OP_REINIT_PAGE_THEME) {
             do_action(OP_SN . '-reinit_page_theme');
         }
     }
 }
示例#2
0
 function init_page()
 {
     if (isset($_POST['page_id'])) {
         define('OP_LIVEEDITOR', true);
         define('OP_PAGEBUILDER_ID', $_POST['page_id']);
         define('OP_PAGEBUILDER', true);
         op_init_page_theme();
         OptimizePress_Default_Assets::_set_font('');
         return true;
     }
     echo json_encode(array('error' => __('The page ID was not found, please refresh and try again', OP_SN)));
     exit;
 }
示例#3
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);
    //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);
    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');
}
示例#4
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');
    wp_enqueue_script('loadScript', OP_JS . 'jquery/jquery.loadScript.js');
    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', 'fixed-width');
    }
    do_action('op_after_init_page');
}