本文整理汇总了PHP中op_page_option函数的典型用法代码示例。如果您正苦于以下问题:PHP op_page_option函数的具体用法?PHP op_page_option怎么用?PHP op_page_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_page_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$this->settings = op_page_option('feature_area');
$this->enabled = true;
$this->oldFeatures = false;
$this->config = new stdClass();
parent::__construct();
//var_dump(op_get_var($this->settings,'type','A'));
// here we put all styles that are using old feature areas for backward compatibility
$oldFeatures = array();
$which = op_get_var($this->settings, 'type', 'A');
$this->which = $which;
if (in_array($which, $oldFeatures)) {
op_page_clean_layouts(array());
//op_page_clear_settings();
$this->oldFeatures = true;
$this->get_options($which);
} else {
//op_page_clean_layouts(array());
//op_page_clear_settings();
$this->oldFeatures = false;
$this->getOptions($which);
}
//var_dump($this->options);
add_filter('op_page_color_options_selectors', array($this, 'color_scheme_selectors'));
add_filter('op_page_color_options', array($this, 'color_scheme_selectors'));
add_filter('op_typography_elements', array($this, 'typography'));
add_filter('op_typography_output_elements', array($this, 'typography_selectors'));
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:29,代码来源:feature_area.php
示例2: sections
static function sections()
{
//Init the static sections variable
static $sections;
//Init the default sections
$defaults = array('seo' => array('title' => __('SEO Options', 'optimizepress'), 'module' => 'seo', 'options' => op_page_config('mod_options', 'seo'), 'on_off' => false), 'scripts' => array('title' => __('Other Scripts', 'optimizepress'), 'module' => 'scripts', 'options' => op_page_config('mod_options', 'scripts'), 'on_off' => false), 'launch_funnel' => array('title' => __('Launch Funnel', 'optimizepress'), 'module' => 'launch_funnel', 'options' => op_page_config('mod_options', 'launch_funnel'), 'module_type' => 'page'), 'exit_redirect' => array('title' => __('Exit Redirect', 'optimizepress'), 'module' => 'exit_redirect', 'options' => op_page_config('mod_options', 'exit_redirect'), 'module_type' => 'page'), 'mobile_redirect' => array('title' => __('Mobile Redirection', 'optimizepress'), 'module' => 'mobile_redirect', 'options' => op_page_config('mod_options', 'mobile_redirection'), 'module_type' => 'page'), 'launch_gateway' => array('title' => __('Launch Gateway', 'optimizepress'), 'module' => 'launch_gateway', 'options' => op_page_config('mod_options', 'launch_gateway'), 'module_type' => 'page'), 'lightbox' => array('title' => __('Lightbox Pop', 'optimizepress'), 'module' => 'lightbox', 'options' => op_page_config('mod_options', 'lightbox'), 'module_type' => 'page'), 'comments' => array('title' => __('Comments System', 'optimizepress'), 'module' => 'comments', 'options' => op_page_config('mod_options', 'comments'), 'on_off' => false));
//If there are no sections set, then we must set them
if (!isset($sections)) {
//Add the default sections to the array
$sections = array('seo' => $defaults['seo'], 'scripts' => $defaults['scripts'], 'launch_funnel' => $defaults['launch_funnel'], 'exit_redirect' => $defaults['exit_redirect'], 'mobile_redirect' => $defaults['mobile_redirect']);
//If the SEO options is set to no, then we remove SEO as an option
if (OP_SEO_ENABLED != 'Y') {
unset($sections['seo']);
}
//Get the keys from the array
$keys = array_keys($sections);
//Loop through each section key
foreach ($keys as $name) {
//Check if this section is disabled and remove from array if so
if (op_page_config('disable', 'functionality', $name) === true) {
unset($sections[$name]);
}
}
//Apply filters to the sections
$sections = apply_filters('op_edit_sections_page_functionality', $sections);
$sections = apply_filters('op_edit_sections_page_functionality_' . op_page_option('theme', 'type'), $sections);
}
//Return the sections
return $sections;
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:30,代码来源:functionality.php
示例3: __construct
function __construct()
{
parent::__construct();
$this->settings = op_page_option('feature_area');
$this->enabled = true;
$this->get_options();
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:7,代码来源:feature_area.php
示例4: display_settings
function display_settings($section_name, $config = array(), $return = false)
{
global $wpdb;
$data = array('fieldid' => $this->get_fieldid($section_name), 'fieldname' => $this->get_fieldname($section_name), 'section_name' => $section_name);
$funnel_dropdown = '';
$current = intval(op_page_option($section_name, 'funnel_id'));
$found = false;
$funnels = $wpdb->get_results("SELECT id,title FROM `{$wpdb->prefix}optimizepress_launchfunnels` ORDER BY title ASC");
$funnel_count = 0;
if ($funnels) {
$funnel_count = count($funnels);
foreach ($funnels as $funnel) {
if ($current < 1) {
$current = $funnel->id;
$found = true;
} elseif ($current == $funnel->id) {
$found = true;
}
$funnel_dropdown .= '<option value="' . $funnel->id . '"' . ($current == $funnel->id ? ' selected="selected"' : '') . '>' . op_attr($funnel->title) . '</option>';
}
}
$data['funnel_count'] = $funnel_count;
$data['funnel_select'] = '<select name="' . $data['fieldname'] . '[funnel_id]" id="' . $data['fieldid'] . 'funnel_id">' . $funnel_dropdown . '</select>';
$this->add_js = true;
$out = $this->load_tpl('settings', $data);
if ($return) {
return $out;
}
echo $out;
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:30,代码来源:launch_funnel.php
示例5: __construct
function __construct()
{
$this->settings = op_page_option('feature_area');
$this->enabled = true;
$this->get_options(op_get_var($this->settings, 'type', 'A'));
parent::__construct();
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:7,代码来源:landing.php
示例6: check_redirect
function check_redirect()
{
$options = op_page_option('mobile_redirect');
$url = op_get_var($options, 'url');
if (op_get_var($options, 'enabled', 'N') == 'Y' && !empty($url)) {
if ($this->is_mobile()) {
header('Location: ' . $url);
exit;
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:11,代码来源:mobile_redirect.php
示例7: __construct
function __construct()
{
$this->settings = op_page_option('feature_area');
$this->enabled = op_get_var($this->settings, 'enabled') == 'Y';
$style = op_get_var($this->settings, 'type');
$style = $style >= 1 && $style <= 7 ? $style : 1;
$this->style = $style;
$this->get_options();
add_filter('op_page_feature_area_launch_selection', array($this, 'style_selector'), 10, 2);
parent::__construct();
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:11,代码来源:launch.php
示例8: op_page_option
<?php
$theme_option = op_page_option('feature_area', 'type');
$size_color = op_page_option('size_color');
if (is_array($size_color) && isset($size_color['box_color_start']) && isset($size_color['box_color_end']) && isset($size_color['box_width'])) {
$box_color_start = $size_color['box_color_start'];
$box_color_end = $size_color['box_color_end'];
$box_width = $size_color['box_width'];
} else {
$box_color_start = op_default_page_option($theme_option, 'size_color', 'box_color_start');
$box_color_end = op_default_page_option($theme_option, 'size_color', 'box_color_end');
$box_width = op_default_page_option($theme_option, 'size_color', 'box_width');
}
?>
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar cf" id="op_page_layout_size_color">
<label for="op_header_layout_box_color_start" class="form-title"><?php
_e('Box background start colour', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
_e('Choose a box background start colour.', OP_SN);
?>
</p>
<?php
op_color_picker('op[size_color][box_color_start]', $box_color_start, 'op_size_color_box_color_start');
?>
<label for="op_header_layout_box_color_end" class="form-title"><?php
_e('Box background end colour', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
开发者ID:denis-chmel,项目名称:wordpress,代码行数:31,代码来源:size_color.php
示例9: save_size_color
function save_size_color($op)
{
$theme_option = op_page_option('feature_area', 'type');
$size_color = op_page_option('size_color');
$size_color = $size_color === false ? array() : $size_color;
$size_color['box_color_start'] = op_get_var($op, 'box_color_start', op_default_page_option($theme_option, 'size_color', 'box_color_start'));
$size_color['box_color_end'] = op_get_var($op, 'box_color_end', op_default_page_option($theme_option, 'size_color', 'box_color_end'));
$size_color['box_width'] = op_get_var($op, 'box_width', op_default_page_option($theme_option, 'size_color', 'box_width'));
op_update_page_option('size_color', $size_color);
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:10,代码来源:layout.php
示例10: op_page_advanced_color_scheme
function op_page_advanced_color_scheme($css)
{
if (op_page_config('disable', 'color_schemes') === true) {
return $css;
}
$advanced = op_page_option('color_scheme_advanced');
$advanced = is_array($advanced) ? $advanced : array();
$type = op_page_option('theme', 'type');
$options = array('page' => array(array('background-image', 'body', 'repeating_bg'), array('background-color', 'body', 'bg_color'), array('color', 'a, a:visited', "['link_color']['color']"), array('text-decoration', 'a,a:visited', "['link_color']['text_decoration']"), array('color', 'a:hover,a:hover', "['link_hover_color']['color']"), array('text-decoration', 'a:hover', "['link_hover_color']['text_decoration']")), 'feature_area' => array(array('gradient', '.featured-panel', 'feature_start', 'feature_end'), array('background-image', '.featured-panel', 'bg'), array('background-size', '.featured-panel', 'bg_options'), array('background-repeat', '.featured-panel', 'bg_options'), array('background-position', '.featured-panel', 'bg_options')), 'footer' => array(array('gradient', '.footer', 'footer_start', 'footer_end'), array('color', '.footer-navigation ul li a', "['footer_link_color']['color']"), array('text-decoration', '.footer-navigation ul li a', "['footer_link_color']['text_decoration']"), array('color', '.footer-navigation ul li a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer-navigation ul li a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer p', 'footer_text_color'), array('color', '.footer h1', 'footer_text_color'), array('color', '.footer h2', 'footer_text_color'), array('color', '.footer h3', 'footer_text_color'), array('color', '.footer h4', 'footer_text_color'), array('color', '.footer h5', 'footer_text_color'), array('color', '.footer h6', 'footer_text_color'), array('color', '.footer a', "['footer_link_color']['color']"), array('text-decoration', '.footer a', "['footer_link_color']['text_decoration']"), array('color', '.footer a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-copyright', 'footer_text_color'), array('color', '.footer small.footer-copyright a', "['footer_link_color']['color']"), array('text-decoration', '.footer small.footer-copyright a', "['footer_link_color']['text_decoration']"), array('color', '.footer small.footer-copyright a:hover', "['footer_link_hover_color']['color']"), array('text-decoration', '.footer small.footer-copyright a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-disclaimer', 'footer_text_color'), array('color', '.footer small.footer-disclaimer a', "['footer_link_color']['color']"), array('text-decoration', '.footer small.footer-disclaimer a', "['footer_link_color']['text_decoration']"), array('text-decoration', '.footer small.footer-disclaimer a:hover', "['footer_link_hover_color']['text_decoration']"), array('color', '.footer small.footer-disclaimer a:hover', "['footer_link_hover_color']['color']")), 'nav_bar_alongside' => array(array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li:hover > a', 'nav_bar_bg_nav_hover'), array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li ul.sub-menu li > a', 'nav_bar_bg'), array('background-color', 'body .container div.include-nav .navigation ul#navigation-alongside li ul.sub-menu li:hover > a', 'nav_bar_bg_hover'), array('color', 'body .container .include-nav .navigation ul li:hover > a,body .container .include-nav .navigation ul a:focus', 'nav_bar_hover'), array('color', 'div.include-nav .navigation ul li a', 'nav_bar_link'), array('color', 'body .container .include-nav .navigation ul li ul li:hover > a,body .container .include-nav .navigation ul li ul li a:focus', 'nav_bar_dd_hover'), array('color', 'div.include-nav .navigation ul li ul li a', 'nav_bar_dd_link')), 'nav_bar_above' => array(array('gradient', '.nav-bar-above', 'nav_bar_start', 'nav_bar_end', 'is_gradient' => false), array('gradient', '.nav-bar-above ul li:hover', 'nav_bar_hover_start', 'nav_bar_hover_end', 'is_gradient' => false), array('background-color', 'body .container .nav-bar-above .navigation ul ul li', 'nav_bar_bg', 'default' => 'nav_bar_end'), array('background-color', 'body .container .nav-bar-above .navigation ul ul li:hover > a,body .container .navigation ul a:focus', 'nav_bar_bg_hover_start'), array('color', '.nav-bar-above a, .nav-bar-above .navigation a', 'nav_bar_link'), array('color', 'body .container .nav-bar-above .navigation ul li:hover > a, body .container .nav-bar-above .navigation ul a:focus', 'nav_bar_hover'), array('color', 'body .container .nav-bar-above .navigation ul li ul li > a, body .container .nav-bar-above .navigation ul li ul a', 'nav_bar_dd_link'), array('color', 'body .container .nav-bar-above .navigation ul li ul li:hover > a,body .container .nav-bar-above .navigation ul li ul a:focus', 'nav_bar_dd_hover')), 'nav_bar_below' => array(array('gradient', '.nav-bar-below.op-page-header', 'nav_bar_start', 'nav_bar_end', 'is_gradient' => false), array('gradient', '.nav-bar-below ul li:hover', 'nav_bar_hover_start', 'nav_bar_hover_end', 'is_gradient' => false), array('background-color', 'body .container .nav-bar-below .navigation ul ul li', 'nav_bar_bg', 'default' => 'nav_bar_end'), array('background-color', 'body .container .nav-bar-below .navigation ul ul li:hover > a,body .container .nav-bar-below .navigation ul a:focus', 'nav_bar_bg_hover_start'), array('color', '.nav-bar-below a, .nav-bar-below .navigation a', 'nav_bar_link'), array('color', 'body .container .nav-bar-below .navigation ul li:hover > a,body .container .nav-bar-below .navigation ul a:focus', 'nav_bar_hover'), array('color', 'body .container .nav-bar-below .navigation ul li ul li > a,body .container .nav-bar-below .navigation ul li ul a:focus', 'nav_bar_dd_link'), array('color', 'body .container .nav-bar-below .navigation ul li ul li:hover > a,body .container .nav-bar-below .navigation ul li ul a:focus', 'nav_bar_dd_hover')));
if ($type != 'launch' && $type != 'landing') {
$options['feature_title'] = array(array('gradient', '.product-feature-tour', 'feature_title_start', 'feature_title_end'), array('color', '.product-feature-tour h2', 'feature_title_text_color'));
}
$options = apply_filters('op_page_color_options_selectors', $options);
$selectors = array();
foreach ($options as $section => $elements) {
$vals = op_get_var($advanced, $section, array());
$selectors = op_page_css_element($selectors, $elements, $vals);
}
foreach ($selectors as $selector => $output) {
$css .= $selector . '{' . implode('', $output) . '}';
}
return $css;
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:23,代码来源:page.php
示例11: array
$preview['li_class'] = $li_class;
$previews[] = $preview;
}
echo $this->load_tpl('generic/img_radio_selector', array('previews' => $previews, 'classextra' => ''));
?>
</div>
<?php
}
?>
</div>
<?php
}
}
// MEMBERSHIP PAGES!!!
if ($page_type == 'membership') {
if (($theme_dir = op_page_option('theme', 'dir')) === false && count($themes) > 0) {
$theme_dir = $themes[0]['dir'];
}
$post = get_post(OP_PAGEBUILDER_ID);
?>
<div style="margin-bottom: 20px;">
<p><?php
_e('Here you can create new products, categories, subcategories and content. To edit them, you must use Live editor for that particular page!', OP_SN);
?>
</p>
<a id="opNewProduct" class="op_membership_button" href="#"><?php
_e('Create new course, product or membership portal', OP_SN);
?>
</a>
<?php
if (OptimizePress_PageBuilder::productExist()) {
开发者ID:shahadat014,项目名称:geleyi,代码行数:31,代码来源:step3.php
示例12: save_advanced
function save_advanced($op)
{
$advanced = op_page_option('color_scheme_advanced');
$advanced = is_array($advanced) ? $advanced : array();
$typography = op_typography_elements();
$current_typography = op_page_option('typography');
if (!is_array($current_typography)) {
$current_typography = op_page_config('default_config', 'typography');
if (!is_array($current_typography)) {
$current_typography = array();
}
}
if (!isset($current_typography['color_elements'])) {
$current_typography['color_elements'] = array();
}
$elements = array('page' => array('link_color' => 'link_color', 'link_hover_color' => 'link_hover_color'), 'footer' => array('text_color' => 'footer_text_color', 'link_color' => 'footer_link_color', 'link_hover_color' => 'footer_link_hover_color'), 'feature_area' => array('text_color' => 'feature_text_color', 'link_color' => 'feature_link_color', 'link_hover_color' => 'feature_link_hover_color'));
$options = $this->_advanced_sections();
foreach ($options as $section => $settings) {
$vals = op_get_var($op, $section, array());
if (!isset($advanced[$section])) {
$advanced[$section] = array();
}
$start_color = '';
foreach ($settings['elements'] as $name => $options) {
$tmp = op_get_var($vals, $name);
//Check if this is a gradient. If so, and the bottom color is empty, set to first color
if (strstr($name, '_start')) {
$start_color = $tmp;
}
if (strstr($name, '_end') && empty($tmp)) {
$tmp = $start_color;
}
if (isset($options['text_decoration'])) {
$newtmp = array('color' => op_get_var($tmp, 'color'), 'text_decoration' => op_get_var($tmp, 'text_decoration'));
} else {
$newtmp = $tmp;
}
$advanced[$section][$name] = $newtmp;
if (isset($elements[$section])) {
if (isset($elements[$section][$name])) {
$current_typography['color_elements'][$elements[$section][$name]] = $newtmp;
}
}
}
}
op_update_page_option('typography', $current_typography);
/*$options = array(
'header' => array('nav_bar_start','nav_bar_end','nav_bar_link'),
'feature_area' => array('feature_start','feature_end'),
'footer' => array('footer_start','footer_end'),
'page' => array('repeating_bg','bg_color','link_color')
);
foreach($options as $name => $fields){
$vals = op_get_var($op,$name,array());
if(!isset($advanced[$name])){
$advanced[$name] = array();
}
foreach($fields as $f){
$advanced[$name][$f] = op_get_var($vals,$f);
}
}*/
op_update_page_option('color_scheme_advanced', $advanced);
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:64,代码来源:color_schemes.php
示例13: _e
echo $fieldid;
?>
time_days" class="form-title"><?php
_e('Expire After');
?>
</label>
<p class="op-micro-copy"><?php
_e('Select the delay after the users first visit to expire the page.');
?>
</p>
<?php
$times = array('days' => array('name' => __('Days', OP_SN), 'length' => 365), 'hours' => array('name' => __('Hours', OP_SN), 'length' => 24), 'minutes' => array('name' => __('Minutes', OP_SN), 'length' => 59), 'seconds' => array('name' => __('Seconds', OP_SN), 'length' => 59));
foreach ($times as $name => $time) {
echo '<select name="' . $fieldname . '[time][' . $name . ']" id="' . $fieldid . 'time_' . $name . '"><option value="">' . $time['name'] . '</option>';
$length = $time['length'] + 1;
$cur = op_page_option($section_name, 'time', $name);
if ($cur === false) {
$cur = '';
}
$add_0 = $name != 'days';
for ($i = 0; $i < $length; $i++) {
echo '<option value="' . $i . '"' . ($cur != '' && $cur == $i ? ' selected="selected"' : '') . '>' . ($add_0 && $i < 10 ? '0' : '') . $i . '</option>';
}
echo '</select>';
}
?>
<label for="<?php
echo $fieldid;
?>
url" class="form-title"><?php
开发者ID:shahadat014,项目名称:geleyi,代码行数:31,代码来源:settings.php
示例14: gateway_key
function gateway_key()
{
$gateway_override = op_page_option('launch_funnel', 'gateway_override');
$found = false;
if (op_get_var($gateway_override, 'enabled') == 'Y') {
if (($key = op_get_var($gateway_override, 'code')) && $key != '') {
$this->custom_key = $key;
$this->use_custom = true;
$found = true;
}
if (($url = op_get_var($gateway_override, 'redirect')) && $url != '') {
$this->custom_redirect = $url;
}
}
if (!$found) {
$gateway_key = op_launch_option('gateway_key');
if (op_get_var($gateway_key, 'enabled', 'N') == 'Y') {
$this->gateway_key = $gateway_key['key'];
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:21,代码来源:launch.php
示例15: defined
<?php
$class = defined('OP_LIVEEDITOR') ? ' op-live-editor' : '';
$type = op_page_option('feature_area', 'type');
if ($type == 'H' || $type == 'I') {
$class .= ' fixed-width-page';
}
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6<?php
echo $class;
?>
" <?php
language_attributes();
?>
> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7<?php
echo $class;
?>
" <?php
language_attributes();
?>
> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8<?php
echo $class;
?>
" <?php
language_attributes();
?>
> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html<?php
开发者ID:JalpMi,项目名称:v2contact,代码行数:31,代码来源:template.php
示例16: _e
?>
</p>
<input id="opContentName" type="text" name="op[content][name]"
value="<?php
echo $post->post_title;
?>
" /> <label><?php
_e('Content description', OP_SN);
?>
</label>
<p><?php
_e('Enter the description for the content', OP_SN);
?>
</p>
<textarea name="op[content][description]"><?php
echo stripslashes(base64_decode(op_page_option('membership', 'description')));
?>
</textarea>
<?php
/*
<label><?php _e('Select product content type', OP_SN) ?></label>
<p><?php _e('This is how it will be presented', OP_SN) ?></p>
<div id="preset-option">
<?php echo $this->load_tpl('generic/img_radio_selector',array('previews'=>$preset_options,'classextra'=>'preset-type-select')); ?>
</div> */
?>
</div>
<?php
}
?>
<?php
开发者ID:JalpMi,项目名称:v2contact,代码行数:31,代码来源:membership.php
示例17: save_membership
/**
* AJAX calls this function to save membership section of Live editor
* @return void
*/
function save_membership()
{
global $wpdb;
$this->check_nonce();
$this->init_page();
$postId = $wpdb->escape($_POST['page_id']);
if (defined("WS_PLUGIN__OPTIMIZEMEMBER_VERSION")) {
c_ws_plugin__optimizemember_meta_box_saves::save_meta_boxes($postId);
}
// saving membership pages options
$op = op_post('op');
$current = op_page_option('membership', 'layout');
// this happens only if we have something to save (it is a membership page!)
if (!empty($op['pageType']['type']) && $op['pageType']['type'] == 'product') {
update_post_meta($op['pageId'], 'type', 'product');
op_update_page_option('membership', 'layout', $op['page']['preset_option']);
// change title and slug
$post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
wp_update_post($post);
}
if (empty($op['pageType']['type']) && !empty($op) && empty($op['type'])) {
// saving product!
update_post_meta($op['pageId'], 'type', 'product');
op_update_page_option('membership', 'layout', $op['page']['preset_option']);
// change title and slug
$post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
wp_update_post($post);
} else {
if ($op['pageType']['type'] == 'category') {
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['category']['name'], 'post_name' => sanitize_title($op['category']['name']), 'post_parent' => $op['pageType']['product']);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['category']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'subcategory') {
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['subcategory']['name'], 'post_name' => sanitize_title($op['subcategory']['name']), 'post_parent' => $op['subcategory']['category']);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['subcategory']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'content') {
if (!empty($op['content']['subcategory'])) {
$parentId = $op['content']['subcategory'];
} else {
if (!empty($op['content']['category'])) {
$parentId = $op['content']['category'];
} else {
$parentId = $op['pageType']['product'];
}
}
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['content']['name'], 'post_name' => sanitize_title($op['content']['name']), 'post_parent' => $parentId);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['content']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
}
}
}
if (!empty($op['type'])) {
$post = array('ID' => $op['pageId'], 'post_parent' => '');
if ($op['type'] == 'product') {
wp_update_post($post);
}
update_post_meta($op['pageId'], 'type', $op['type']);
}
}
//error_log(OP_PAGEBUILDER_ID);
if (!empty($op['typeForChange'])) {
$value = array('type' => 'membership', 'dir' => '1');
update_post_meta(OP_PAGEBUILDER_ID, '_' . OP_SN . '_theme', maybe_serialize($value));
update_post_meta(OP_PAGEBUILDER_ID, 'type', $op['typeForChange']);
}
/*
* DAP integration
*/
if (isset($op['membership']['dap_redirect_url'])) {
update_post_meta($postId, 'dap_redirect_url', $op['membership']['dap_redirect_url']);
}
/*
* Fast Member integration
*/
if (isset($op['membership']['fast_member_redirect_url'])) {
update_post_meta($postId, 'fast_member_redirect_url', $op['membership']['fast_member_redirect_url']);
}
/*
* iMember360 integration
*/
if (isset($op['membership']['imember_redirect_url'])) {
//.........这里部分代码省略.........
开发者ID:denis-chmel,项目名称:wordpress,代码行数:101,代码来源:live_editor.php
示例18: page_file
function page_file($tpl, $data = array(), $path = null)
{
static $tpl_dir, $tpl_type;
if (!isset($tpl_dir)) {
$tpl_dir = op_page_option('theme', 'dir');
$tpl_type = op_page_option('theme', 'type');
}
if ($tpl_dir) {
$data['theme_url'] = OP_URL . 'pages/' . $tpl_type . '/' . $tpl_dir . '/';
$data['theme_path'] = OP_PAGES . $tpl_type . '/' . $tpl_dir . '/';
$data['img_url'] = $data['theme_url'] . 'img/';
$path = is_null($path) ? $data['theme_path'] : $path;
return $this->_load_file($path . $tpl . '.php', $data, false);
}
return '';
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:16,代码来源:templates.php
示例19: save_step_3
function save_step_3()
{
if (isset($_POST['theme_id']) && ($conf = op_load_page_config($_POST['theme_id']))) {
$cur = op_page_option('theme', 'dir');
if ($cur === false || $cur != $_POST['theme_id']) {
// removed clearing settings on theme/type change
//op_page_clear_settings();
//op_page_clean_layouts(array());
op_update_page_option('theme', 'dir', $_POST['theme_id']);
}
$type = op_page_option('theme', 'type');
if ($type == 'membership') {
$this->save_membership_settings($conf);
} elseif ($type == 'landing') {
if ($feature = op_post('op', 'feature_area', $_POST['theme_id'])) {
op_update_page_option('feature_area', 'type', $feature);
op_update_page_option('feature_area', 'enabled', 'Y');
/*
$feature_area = op_page_option('feature_area');
if(!$feature_area){
$feature_area = array();
}
$feature_area['type'] = $feature;
$feature_area['enabled'] = 'Y';
op_update_page_option('feature_area',$feature_area);*/
}
}
}
$this->_redirect();
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:30,代码来源:page_builder.php
示例20: op_page_url
function op_page_url($path, $dir = null, $type = null)
{
static $page_type;
if (!isset($page_type)) {
$page_type = op_page_option('theme', 'type');
}
if (is_null($dir)) {
$dir = op_page_option('theme', 'dir');
}
return OP_URL . 'pages/' . $page_type . '/' . $dir . '/' . ltrim($path, '/');
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:11,代码来源:general.php
注:本文中的op_page_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论