本文整理汇总了PHP中op_page_option函数的典型用法代码示例。如果您正苦于以下问题:PHP op_page_option函数的具体用法?PHP op_page_option怎么用?PHP op_page_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_page_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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'));
}
示例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;
}
示例3: __construct
function __construct()
{
parent::__construct();
$this->settings = op_page_option('feature_area');
$this->enabled = true;
$this->get_options();
}
示例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;
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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
示例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);
}
示例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;
}
示例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()) {
示例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);
}
示例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
示例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'];
}
}
}
示例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