本文整理汇总了PHP中ploption函数的典型用法代码示例。如果您正苦于以下问题:PHP ploption函数的具体用法?PHP ploption怎么用?PHP ploption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ploption函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: section_template
/**
*
* @TODO document
*
*/
function section_template($clone_id = null)
{
$h_head = ploption('_highlight_head', $this->tset);
$h_subhead = ploption('_highlight_subhead', $this->tset);
$h_splash = ploption('_highlight_splash', $this->tset);
$h_splash_position = ploption('_highlight_splash_position', $this->oset);
$frame_class = ploption('_highlight_image_frame', $this->oset) ? 'pl-imageframe' : '';
if ($h_head || $h_subhead || $h_splash) {
?>
<div class="highlight-area">
<?php
if ($h_splash_position == 'top' && $h_splash) {
printf('<div class="highlight-splash hl-image-top %s"><img src="%s" alt="" /></div>', $frame_class, $h_splash);
}
if ($h_splash_position != 'notext') {
if ($h_head) {
printf('<h1 class="highlight-head">%s</h1>', __($h_head, 'pagelines'));
}
if ($h_subhead) {
printf('<h3 class="highlight-subhead subhead">%s</h3>', __($h_subhead, 'pagelines'));
}
}
if ($h_splash_position != 'top' && $h_splash) {
printf('<div class="highlight-splash hl-image-bottom %s"><img src="%s" alt="" /></div>', $frame_class, apply_filters('pl_highlight_splash', $h_splash));
}
?>
</div>
<?php
} else {
echo setup_section_notify($this, __('Set highlight page options to activate.', 'pagelines'));
}
}
示例2: __construct
/**
* PHP5 constructor
* @param bool $template_type
*/
function __construct($template_type = false)
{
global $post;
global $pl_section_factory;
global $passive_sections;
// passive sections for loading
$post = !isset($post) && isset($_GET['post']) ? get_post($_GET['post'], 'object') : $post;
$this->factory = $pl_section_factory->sections;
// All section control settings
$sc_set = is_pagelines_special() ? PAGELINES_SPECIAL : PAGELINES_TEMPLATES;
$this->scontrol = ploption('section-control', array('setting' => $sc_set));
$this->sc_default = ploption('section-control', array('setting' => PAGELINES_TEMPLATES));
$this->map = $this->get_map();
// Add passive sections
$this->passive_sections = $passive_sections;
/**
* Template Type
* This is how we decide which sections belong on the page
*/
if ($template_type != false) {
$this->template_type = $template_type;
} else {
if (is_admin()) {
$this->template_type = $this->admin_page_type_breaker();
} else {
$this->template_type = $this->page_type_breaker();
}
}
if (!is_admin()) {
$this->template_name = $this->page_type_name();
}
$this->load_sections_on_hook_names();
}
示例3: section_template
/**
* Section template.
*/
function section_template($clone_id)
{
$hero_lt_width = ploption('herounit_left_width', $this->oset);
if (!$hero_lt_width) {
$hero_lt_width = 'span6';
}
$hero_rt_width = ploption('herounit_right_width', $this->oset);
if (!$hero_rt_width) {
$hero_rt_width = 'span6';
}
$hero_title = ploption('pagelines_herounit_title', $this->tset);
$hero_tag = ploption('pagelines_herounit_tagline', $this->tset);
$hero_img = ploption('pagelines_herounit_image', $this->tset);
$hero_butt_link = ploption('herounit_button_link', $this->oset);
$hero_butt_text = ploption('herounit_button_text', $this->oset);
$hero_butt_target = ploption('herounit_button_target', $this->oset) ? ' target="_blank"' : '';
$hero_butt_theme = ploption('herounit_button_theme', $this->oset);
if ($hero_title) {
?>
<div class="pl-hero-wrap row">
<?php
if ($hero_lt_width) {
printf('<div class="pl-hero %s">', $hero_lt_width);
}
?>
<?php
if ($hero_title) {
printf('<h1 class="m-bottom">%s</h1>', $hero_title);
}
if ($hero_tag) {
printf('<p>%s</p>', $hero_tag);
}
if ($hero_butt_link) {
printf('<a %s class="btn btn-%s btn-large" href="%s">%s</a> ', $hero_butt_target, $hero_butt_theme, $hero_butt_link, $hero_butt_text);
}
?>
</div>
<?php
if ($hero_rt_width) {
printf('<div class="pl-hero-image %s">', $hero_rt_width);
}
?>
<?php
if ($hero_img) {
printf('<div class="hero_image"><img class="pl-imageframe" src="%s" /></div>', apply_filters('pl_hero_image', $hero_img));
}
?>
</div>
</div>
<?php
} else {
echo setup_section_notify($this, __('Set Hero page options to activate.', 'pagelines'));
}
}
示例4: pl_fix_admin_favicon
/**
* Fix The WordPress Favicon by Site Title
*/
function pl_fix_admin_favicon()
{
if (!($image_url = ploption('pagelines_favicon'))) {
return;
}
$css = "\n\t\t#wphead #header-logo {\n\t\t\tbackground: url({$image_url}) no-repeat scroll center center;\n\t\t}";
inline_css_markup('pagelines-wphead-img', $css);
}
示例5: register_actions
/**
*
* @TODO document
*
*/
function register_actions()
{
$privelidge = ploption('hide_controls_meta') ? ploption('hide_controls_meta') : 'publish_posts';
if (!current_user_can($privelidge)) {
return;
}
// Adds the box
add_action('admin_menu', array(&$this, 'add_metapanel_box'));
// Saves the options.
add_action('post_updated', array(&$this, 'save_meta_options'));
}
示例6: __construct
/**
* Construct
*/
function __construct($oid, $o, $setting = PAGELINES_SETTINGS)
{
global $pagelines_template;
global $pl_section_factory;
$oset = array('setting' => $setting);
$this->sc_settings = ploption('section-control', $oset);
$this->sc_global = ploption('section-control', array('setting' => PAGELINES_TEMPLATES));
$this->sc_namespace = sprintf('%s[section-control]', $setting);
$this->template_map = get_option(PAGELINES_TEMPLATE_MAP);
$this->factory = $pl_section_factory->sections;
$this->template = $pagelines_template;
}
示例7: render_css
/**
* CSS Rendering In <head>
*/
function render_css()
{
global $pagelines_ID;
$css = '';
if (has_action('override_pagelines_css_output')) {
return;
}
foreach (get_option_array() as $menu) {
foreach ($menu as $oid => $o) {
if (!is_array($o)) {
$o = array();
}
$oset = array('post_id' => $pagelines_ID);
$o['val'] = ploption($oid, $oset);
if (!empty($o['selectvalues']) && is_array($o['selectvalues'])) {
foreach ($o['selectvalues'] as $sid => $s) {
$o['selectvalues'][$sid]['val'] = ploption($sid, $oset);
}
}
if (!ploption('supersize_bg', $oset) && isset($o['type']) && $o['type'] == 'background_image' && ploption($oid . '_url', $oset)) {
$bg_repeat = ploption($oid . '_repeat', $oset) ? ploption($oid . '_repeat', $oset) : 'no-repeat';
$bg_attach = ploption($oid . '_attach', $oset) ? ploption($oid . '_attach', $oset) : 'scroll';
$bg_pos_vert = ploption($oid . '_pos_vert', $oset) || ploption($oid . '_pos_vert', $oset) == 0 ? (int) ploption($oid . '_pos_vert', $oset) : '0';
$bg_pos_hor = ploption($oid . '_pos_hor', $oset) || ploption($oid . '_pos_hor', $oset) == 0 ? (int) ploption($oid . '_pos_hor', $oset) : '50';
$bg_selector = ploption($oid . '_selector', $oset) ? ploption($oid . '_selector', $oset) : $o['selectors'];
$bg_url = ploption($oid . '_url', $oset);
$css .= sprintf('%s{ background-image:url(%s);}', $bg_selector, $bg_url);
$css .= sprintf('%s{ background-repeat: %s;}', $bg_selector, $bg_repeat);
$css .= sprintf('%s{ background-attachment: %s;}', $bg_selector, $bg_attach);
$css .= sprintf('%s{ background-position: %s%% %s%%;}', $bg_selector, $bg_pos_hor, $bg_pos_vert);
} elseif (isset($o['type']) && $o['type'] == 'colorpicker') {
$this->render_css_colors($oid, $o['cssgroup'], $o['css_prop']);
} elseif (isset($o['type']) && $o['type'] == 'color_multi') {
foreach ($o['selectvalues'] as $mid => $m) {
$cprop = isset($m['css_prop']) ? $m['css_prop'] : 'color';
if ($m['val'] != '' && isset($m['selectors']) && $m['selectors'] != '') {
$rules = $this->load_the_props($cprop, $m['val']);
$rules .= do_color_math($mid, $m, $m['val']);
$css .= sprintf('%s %s{%s} /* %s */ %s %s', "\n", $m['selectors'], $rules, $mid, "\n", "\n");
} else {
$cgroup = isset($m['cssgroup']) ? $m['cssgroup'] : null;
$cprop = isset($m['css_prop']) ? $m['css_prop'] : null;
$this->render_css_colors($mid, $m, $cgroup, $cprop);
}
}
}
}
}
$css .= $this->parse_css_factory();
return $css;
}
示例8: __construct
/**
*
* @TODO document
*
*/
function __construct()
{
if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) {
update_option(PAGELINES_SETTINGS, pagelines_settings_defaults());
update_option(PAGELINES_TEMPLATE_MAP, the_template_map());
}
/**
* Insure the correct default logo is being displayed after import.
*/
if (!VPRO && 'logo-platform.png' == basename(ploption('pagelines_custom_logo'))) {
plupop('pagelines_custom_logo', PL_IMAGES . '/logo.png');
}
/**
* Fix broken repeated excerpt problem on pagelines.com
*/
if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) {
if (!isset($a['content_blog']) || true != $a['content_blog']) {
plupop('content_blog', true);
}
if (!isset($a['content_blog']) || true == $a['excerpt_blog']) {
plupop('excerpt_blog', false);
}
/**
* Fix broken templates
*/
$t = (array) get_option(PAGELINES_TEMPLATE_MAP, the_template_map());
$s = (array) get_option(PAGELINES_SPECIAL);
$t['main']['templates']['posts']['sections'] = array('PageLinesQuickSlider', 'PageLinesBoxes');
$s['posts']['_pagelines_layout_mode'] = 'fullwidth';
update_option(PAGELINES_SPECIAL, $s);
update_option(PAGELINES_TEMPLATE_MAP, $t);
plupop('pagelines_version', CORE_VERSION);
}
/**
* Upgrade from Platform(pro) to PageLines and import settings.
*/
$pagelines = get_option(PAGELINES_SETTINGS);
$platform = get_option(PAGELINES_SETTINGS_LEGACY);
if (is_array($pagelines)) {
if (!isset($settings['pagelines_version'])) {
plupop('pagelines_version', CORE_VERSION);
}
// were done.
return;
}
if (is_array($platform)) {
$this->upgrade($platform);
}
}
示例9: shortcode
public function shortcode($atts, $content, $tag)
{
$data = array();
foreach ($this->get_options() as $key => $o) {
$value = ploption($key);
if ($value) {
$data[$key] = sprintf($o['format'], $value);
}
}
$data = array_filter($data);
if (empty($data)) {
return '';
} else {
$icons = implode("\n", $data);
return "<div class='social-icons'>{$icons}</div>";
}
}
示例10: section_head
/**
*
* @TODO document
*
*/
function section_head()
{
$arrows = ploption('drop_down_arrows') == 'on' ? 1 : 0;
$shadows = ploption('drop_down_shadow') == 'on' ? 1 : 0;
if (ploption('enable_drop_down')) {
?>
<script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function() { jQuery('div.brandnav-nav ul.sf-menu').superfish({ delay: 100, speed: 'fast', autoArrows: <?php
echo $arrows;
?>
, dropShadows: <?php
echo $shadows;
?>
}); }); /* ]]> */ </script>
<?php
}
}
示例11: pagelines_register_settings
/**
*
* @TODO document
*
*/
function pagelines_register_settings()
{
register_setting(PAGELINES_SETTINGS, PAGELINES_SETTINGS, 'pagelines_settings_callback');
register_setting(PAGELINES_SPECIAL, PAGELINES_SPECIAL);
register_setting(PAGELINES_TEMPLATES, PAGELINES_TEMPLATES);
/* Typography Options */
$GLOBALS['pl_foundry'] = new PageLinesFoundry();
/*
Import/Exporting
*/
pagelines_import_export();
pagelines_process_reset_options();
if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'pagelines') {
return;
}
global $new_default_settings;
/*
New Default Options in Child Themes
*/
if (!isset($_GET['newoptions']) && pagelines_activate_or_reset() && !empty($new_default_settings)) {
$type = sprintf('&%s=true', pagelines_activate_or_reset());
foreach ($new_default_settings as $key => $set) {
plupop($set['key'], $set['value'], array('parent' => $set['parent'], 'subkey' => $set['subkey'], 'setting' => $set['setting']));
}
wp_redirect(admin_url(PL_SETTINGS_URL . '&newoptions=true' . $type));
}
/*
Handle Reset of Options
*/
if (ploption('reset')) {
update_option(PAGELINES_SETTINGS, pagelines_settings_defaults());
global $extension_control;
$extension_control->flush_caches();
wp_redirect(admin_url(PL_SETTINGS_URL . '&reset=true'));
exit;
}
}
示例12: section_optionator
/**
*
* Page-by-page options for PostPins
*
*/
function section_optionator($settings)
{
$settings = wp_parse_args($settings, $this->optionator_default);
$array = array();
$array['quick_slides'] = array('type' => 'count_select', 'count_start' => 1, 'count_number' => 10, 'default' => '3', 'inputlabel' => __('Number of Slides to Configure', 'pagelines'), 'title' => __('Number of Slides', 'pagelines'), 'shortexp' => __('Enter the number of QuickSlider slides. <strong>Default is 3</strong>', 'pagelines'), 'exp' => __("This number will be used to generate slides and option setup.", 'pagelines'));
$array['quick_transition'] = array('type' => 'select', 'selectvalues' => array('fade' => array('name' => __('Use Fading Transition', 'pagelines')), 'slide_h' => array('name' => __('Use Slide/Horizontal Transition', 'pagelines'))), 'inputlabel' => __('Select Transition Type', 'pagelines'), 'title' => __('Slider Transition Type', 'pagelines'), 'shortexp' => __('Configure the way slides transfer to one another.', 'pagelines'), 'exp' => __("", 'pagelines'));
$array['quick_nav'] = array('type' => 'select', 'selectvalues' => array('both' => array('name' => __('Use Both Arrow and Slide Control Navigation', 'pagelines')), 'none' => array('name' => __('No Navigation', 'pagelines')), 'control_only' => array('name' => __('Slide Controls Only', 'pagelines')), 'arrow_only' => array('name' => __('Arrow Navigation Only', 'pagelines'))), 'inputlabel' => __('Slider Navigation', 'pagelines'), 'title' => __('Slider Navigation mode', 'pagelines'), 'shortexp' => __('Configure the navigation for this slider.', 'pagelines'), 'exp' => __("", 'pagelines'));
$array['quick_slideshow'] = array('type' => 'check', 'inputlabel' => __('Animate Slideshow Automatically?', 'pagelines'), 'title' => __('Automatic Slideshow?', 'pagelines'), 'shortexp' => __('Autoplay the slides, transitioning every 7 seconds.', 'pagelines'), 'exp' => __("", 'pagelines'));
global $post_ID;
$oset = array('post_id' => $post_ID, 'clone_id' => $settings['clone_id'], 'type' => $settings['type']);
$slides = ploption('quick_slides', $oset) ? ploption('quick_slides', $oset) : $this->default_limit;
for ($i = 1; $i <= $slides; $i++) {
$array['quick_slide_' . $i] = array('type' => 'multi_option', 'selectvalues' => array('quick_image_' . $i => array('inputlabel' => __('Slide Image', 'pagelines'), 'type' => 'image_upload'), 'quick_img_alt_' . $i => array('inputlabel' => __('Image Alt', 'pagelines'), 'type' => 'text'), 'quick_text_' . $i => array('inputlabel' => __('Slide Text', 'pagelines'), 'type' => 'textarea'), 'quick_link_' . $i => array('inputlabel' => __('Slide Link URL', 'pagelines'), 'type' => 'text'), 'quick_text_location_' . $i => array('inputlabel' => __('Slide Text Location', 'pagelines'), 'type' => 'select', 'selectvalues' => array('right_bottom' => array('name' => 'Right/Bottom'), 'right_top' => array('name' => 'Right/Top'), 'left_bottom' => array('name' => 'Left/Bottom'), 'left_top' => array('name' => 'Left/Top')))), 'title' => __('QuickSlider Slide ', 'pagelines') . $i, 'shortexp' => __('Setup options for slide number ', 'pagelines') . $i, 'exp' => __('For best results all images in the slider should have the same dimensions.', 'pagelines'));
}
$metatab_settings = array('id' => 'quickslider_options', 'name' => __('QuickSlider', 'pagelines'), 'icon' => $this->icon, 'clone_id' => $settings['clone_id'], 'active' => $settings['active']);
register_metatab($metatab_settings, $array);
}
示例13: draw_banners
/**
*
* @TODO document
*
*/
function draw_banners($b, $class = "")
{
?>
<div class="banner_container fix <?php
echo $class;
?>
">
<?php
foreach ($b as $bpost) {
$oset = array('post_id' => $bpost->ID);
$banner_text_width = ploption('banner_text_width', $oset) ? ploption('banner_text_width', $oset) : 50;
$banner_media_width = 100 - $banner_text_width;
// Math
$banner_align = ploption('banner_align', $oset) ? ploption('banner_align', $oset) : 'banner_left';
$pad = ploption('banner_text_padding', $oset);
$banner_text_padding = $pad ? sprintf('padding:%s;', $pad) : "padding: 20px 40px";
$pad_flag = $pad ? 'with-pad' : 'no-pad';
?>
<div class="banner-area pprand-pad <?php
echo $banner_align . ' ' . $pad_flag;
?>
">
<div class="banner-text pprand" style="width:<?php
echo $banner_text_width;
?>
%;">
<div class="banner-text-pad pprand-pad" style="<?php
echo $banner_text_padding;
?>
">
<div class="banner-text-wrap">
<div class="banner-title">
<h2><?php
echo do_shortcode($bpost->post_title);
?>
</h2>
</div>
<div class="banner-content">
<?php
echo apply_filters('the_content', do_shortcode($bpost->post_content) . pledit($bpost->ID));
?>
</div>
</div>
</div>
</div>
<div class="banner-media pprand" style="width:<?php
echo $banner_media_width;
?>
%;" >
<div class="banner-media-pad pprand-pad">
<?php
echo do_shortcode(self::_get_banner_media($oset));
?>
</div>
</div>
<div class="clear"></div>
</div>
<?php
}
?>
</div><div class="clear"></div>
<?php
}
示例14: render_css
/**
*
* @TODO document
*
*/
function render_css()
{
$css = '';
foreach (get_option_array() as $mid) {
foreach ($mid as $oid => $o) {
if (isset($o['type']) && $o['type'] == 'typography') {
$type = ploption($oid);
$font_id = $type['font'];
// Don't render if font isn't set.
if (isset($font_id) && isset($this->foundry[$font_id])) {
if ($this->foundry[$font_id]['google']) {
$google_fonts[] = $font_id;
}
$type_selectors = $o['selectors'];
if (isset($type['selectors']) && !empty($type['selectors'])) {
$type_selectors .= ',' . trim(trim($type['selectors']), ',');
}
$type_css = $this->get_type_css($type);
$type_css_keys[] = $type_selectors . '{' . $type_css . '}';
}
}
}
}
if (isset($google_fonts) && is_array($google_fonts)) {
$css .= $this->google_import($google_fonts);
}
// Render the font CSS
if (isset($type_css_keys) && is_array($type_css_keys)) {
foreach ($type_css_keys as $typeface) {
$css .= $typeface;
}
}
return $css;
}
示例15: post_meta_setup
/**
*
* @TODO document
*
*/
function post_meta_setup()
{
$pt_tab_options = array('feature_styling' => array('type' => 'multi_option', 'title' => __('Feature Design Style', 'pagelines'), 'shortexp' => __('The basic styling of the feature', 'pagelines'), 'selectvalues' => array('feature-style' => array('type' => 'select', 'inputlabel' => __('Feature Text Position', 'pagelines'), 'selectvalues' => array('text-left' => array('name' => __('Text On Left', 'pagelines')), 'text-right' => array('name' => __('Text On Right', 'pagelines')), 'text-bottom' => array('name' => __('Text On Bottom', 'pagelines')), 'text-none' => array('name' => __('Full Width Background Image - No Text - Links Entire BG', 'pagelines')))), 'feature-design' => array('type' => 'select', 'inputlabel' => __('Feature Design Style', 'pagelines'), 'selectvalues' => array('fstyle-darkbg-overlay' => array('name' => __('White Text - Dark Feature Background - Transparent Text Overlay (Default)', 'pagelines')), 'fstyle-lightbg' => array('name' => __('Black Text - Light Feature Background with Border - No Overlay', 'pagelines')), 'fstyle-darkbg' => array('name' => __('White Text - Dark Feature Background - No Overlay', 'pagelines')), 'fstyle-nobg' => array('name' => __('Black Text - No Feature Background - No Overlay', 'pagelines')))))), 'feature_media_stuff' => array('type' => 'multi_option', 'title' => __('Feature Media', 'pagelines'), 'shortexp' => __('The media that the feature will use', 'pagelines'), 'selectvalues' => array('feature-background-image' => array('inputlabel' => __('Full Size - Feature Background Image', 'pagelines'), 'type' => 'image_upload'), 'feature-media-image' => array('version' => 'pro', 'type' => 'image_upload', 'inputlabel' => __('Media Area - Image (optional)', 'pagelines')), 'feature-media' => array('version' => 'pro', 'type' => 'textarea', 'inputlabel' => __('Feature HTML (video embeds etc, In Media Area)', 'pagelines')), 'feature-media-full' => array('version' => 'pro', 'type' => 'check', 'inputlabel' => __('Make Feature HTML Full Width', 'pagelines')), 'feature-thumb' => array('inputlabel' => __('Thumb Navigation - Upload Feature Thumbnail (50px by 30px)', 'pagelines'), 'type' => 'image_upload'), 'feature-name' => array('default' => '', 'inputlabel' => __('Names Navigation - Enter Text', 'pagelines'), 'type' => 'text'))), 'feature-link-url' => array('shortexp' => __('Adding a URL here will add a link to your feature slide', 'pagelines'), 'title' => __('Feature Link URL', 'pagelines'), 'label' => __('Enter Feature Link URL', 'pagelines'), 'type' => 'text', 'exp' => __('Adds a More link to your text. If you have Full Width Background Image mode selected, the entire slide will be linked.', 'pagelines')), 'feature-link-text' => array('default' => 'More', 'shortexp' => __('Enter the text you would like in your feature link', 'pagelines'), 'title' => __('Link Text', 'pagelines'), 'label' => __('Enter Feature Link Text', 'pagelines'), 'type' => 'text', 'size' => 'small'));
$posts_mode = ploption('posts_feature_control') ? true : false;
// Add options for correct post type.
$post_types = $posts_mode ? array($this->ptID, 'post') : array($this->ptID);
$pt_panel = array('id' => 'feature-metapanel', 'name' => __('Feature Setup Options', 'pagelines'), 'posttype' => $post_types, 'hide_tabs' => true);
$pt_panel = new PageLinesMetaPanel($pt_panel);
$pt_tab = array('id' => 'feature-type-metatab', 'name' => __('Feature Setup Options', 'pagelines'), 'icon' => $this->icon);
$pt_panel->register_tab($pt_tab, $pt_tab_options);
}