当前位置: 首页>>代码示例>>PHP>>正文


PHP option::is_on方法代码示例

本文整理汇总了PHP中option::is_on方法的典型用法代码示例。如果您正苦于以下问题:PHP option::is_on方法的具体用法?PHP option::is_on怎么用?PHP option::is_on使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在option的用法示例。


在下文中一共展示了option::is_on方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register_admin_pages

 /**
  * WPZOOM custom menu for wp-admin
  */
 public static function register_admin_pages()
 {
     add_object_page('Page Title', 'WPZOOM', 'manage_options', 'wpzoom_options', 'WPZOOM_Admin::admin', WPZOOM::$assetsPath . '/images/shortcode-icon.png');
     add_submenu_page('wpzoom_options', 'WPZOOM', 'Theme Options', 'manage_options', 'wpzoom_options', array(__CLASS__, 'admin'));
     if (option::is_on('framework_update_enable')) {
         add_submenu_page('wpzoom_options', 'Update Framework', 'Update Framework', 'update_themes', 'wpzoom_update', array(__CLASS__, 'update'));
     }
     if (option::is_on('framework_newthemes_enable') && !wpzoom::$tf) {
         add_submenu_page('wpzoom_options', 'New Themes', 'New Themes', 'manage_options', 'wpzoom_themes', array(__CLASS__, 'themes'));
     }
 }
开发者ID:siriuzwhite,项目名称:alpha,代码行数:14,代码来源:admin.php

示例2: init

 public static function init()
 {
     if (option::is_on('framework_update_enable') && option::is_on('framework_update_notification_enable')) {
         add_action('admin_head', array('WPZOOM_Framework_Updater', 'update_init'));
         add_action('admin_head', array('WPZOOM_Framework_Updater', 'check_update'));
     }
     if (option::is_on('framework_theme_update_notification_enable') && !wpzoom::$tf) {
         add_action('admin_head', array('WPZOOM_Theme_Updater', 'check_update'));
     }
     add_action('wp_ajax_wpzoom_updater', array(__CLASS__, 'ajax'));
 }
开发者ID:siriuzwhite,项目名称:alpha,代码行数:11,代码来源:updater.php

示例3: init

 public static function init()
 {
     add_action('after_setup_theme', array(__CLASS__, 'add_feed_links'));
     if (option::is_on("meta_generator")) {
         add_action('wp_head', array(__CLASS__, 'meta_generator'));
     }
     add_action('wp_title', array(__CLASS__, 'wp_title'), 10, 2);
     add_action('wp_head', array(__CLASS__, 'favicon'));
     add_action('wp_head', array(__CLASS__, 'generate_options_css'));
     add_action('wp_head', array(__CLASS__, 'header_code'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'theme_styles'), 20);
     add_action('wp_enqueue_scripts', array(__CLASS__, 'theme_scripts'));
     add_action('wp_footer', array(__CLASS__, 'footer_code'));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:14,代码来源:theme.php

示例4: fonts_families_preview

 /**
  * Generates CSS to preview Typography Fonts families
  *
  * @return void
  */
 public static function fonts_families_preview()
 {
     if (!option::is_on('framework_fonts_preview')) {
         return;
     }
     $css = '';
     $fonts = '';
     $font_families = ui::recognized_font_families();
     $google_font_families = ui::recognized_google_webfonts_families();
     foreach ($font_families as $slug => $font) {
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font . ';}';
     }
     foreach ($google_font_families as $font) {
         if (isset($font['separator'])) {
             continue;
         }
         $slug = str_replace(' ', '-', strtolower($font['name']));
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font['name'] . ';}';
         $fonts .= $font['name'] . '|';
     }
     $fonts = str_replace(" ", "+", $fonts);
     $google_css = '@import url("http' . (is_ssl() ? 's' : '') . '://fonts.googleapis.com/css?family=' . $fonts . "\");\n";
     $google_css = str_replace('|"', '"', $google_css);
     echo '<style type="text/css">';
     echo $google_css;
     echo $css;
     echo '</style>';
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:33,代码来源:settings-page.php

示例5: add_node_to_admin_bar

 /**
  * Add Theme Options to Admin Bar
  *
  * @param WP_Admin_Bar $wp_admin_bar
  */
 public static function add_node_to_admin_bar($wp_admin_bar)
 {
     if (!is_super_admin() || !is_admin_bar_showing()) {
         return;
     }
     $wp_admin_bar->add_menu(array('id' => 'wpzoom', 'title' => __('WPZOOM', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_options')));
     $wp_admin_bar->add_menu(array('id' => 'wpzoom-theme-options', 'parent' => 'wpzoom', 'title' => __('Theme Options', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_options')));
     if (option::is_on('framework_update_enable')) {
         $wp_admin_bar->add_menu(array('id' => 'wpzoom-framework-update', 'parent' => 'wpzoom', 'title' => __('Framework Update', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_update')));
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:16,代码来源:wpzoom.php

示例6: seo_notification

 public function seo_notification()
 {
     if (!option::is_on('seo_enable')) {
         return;
     }
     // don't show notification if seo is disabled
     if (option::get('framework_seo_aware')) {
         return;
     }
     // don't show notification if it was hidden
     if (WPZOOM::$theme_raw_name == 'angle') {
         return;
     }
     // don't show notification for new themes
     if (WPZOOM::$theme_raw_name == 'compass') {
         return;
     }
     // don't show notification for new themes
     if (!current_user_can('install_plugins')) {
         return;
     }
     // don't show notification if current user can't install plugins
     echo '<div class="zoomfw-seo update-nag">';
     echo '<p>';
     echo __('WPZOOM SEO Settings are deprecated and will be removed in the next ZOOM Framework update. ', 'wpzoom');
     echo sprintf(__('You can disable WPZOOM SEO from <a href="%s">Theme Options</a>.', 'wpzoom'), esc_url(admin_url('admin.php?page=wpzoom_options')));
     echo '</p>';
     if (is_multisite()) {
         echo sprintf('<p>%s</p>', __('In case you are using our themes on a multisite install don\'t forget to notify your users about this change.', 'wpzoom'));
     }
     echo sprintf('<p>%s</p>', __('Recommended SEO Plugin is <a href="http://wordpress.org/plugins/wordpress-seo/">WordPress SEO by Yoast</a>.', 'wpzoom'));
     echo '<input type="button" class="close button" value="Hide" /></div>';
 }
开发者ID:Bobcatou,项目名称:thenewreaganvision,代码行数:33,代码来源:admin.php

示例7: seo

 /**
  * Handles SEO Options
  */
 public static function seo()
 {
     global $post;
     if (option::is_on('seo_enable')) {
         if (is_singular()) {
             if ($post->post_excerpt !== '') {
                 $description = $post->post_excerpt;
             } else {
                 $content = str_replace(']]>', ']]&gt;', $post->post_content);
                 $content = preg_replace('|\\[(.+?)\\](.+?\\[/\\1\\])?|s', '', $content);
                 $content = strip_tags($content);
                 $description = strlen($content) < 155 ? $content : substr($content, 0, strpos($content, " ", 155));
             }
             echo '<meta name="description" content="' . esc_attr(strip_tags(stripslashes($description))) . '" />' . "\n";
             self::metaPostKeywords();
         } elseif (is_home()) {
             echo '<meta name="description" content="' . self::description() . '" />' . "\n";
             self::metaHomeKeywords();
         }
         self::index();
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:25,代码来源:theme.php

示例8:

/* Video API */
require_once WPZOOM_INC . "/components/video-api.php";
if (is_admin()) {
    require_once WPZOOM_INC . "/components/video-thumb.php";
}
/* Load get the image file only when it's not installed as a plugin */
if (!function_exists('get_the_image')) {
    require_once WPZOOM_INC . "/components/get-the-image.php";
}
/* Require shortcodes */
if (option::is_on('framework_shortcodes_enable')) {
    require_once WPZOOM_INC . "/components/shortcodes/shortcodes.php";
    require_once WPZOOM_INC . "/components/shortcodes/init.php";
}
/* wzslider */
if (option::is_on('framework_wzslider_enable')) {
    require_once WPZOOM_INC . "/components/shortcodes/wzslider.php";
}
require_once WPZOOM_INC . "/components/theme/ui.php";
if (!is_admin()) {
    require_once WPZOOM_INC . "/components/theme/theme.php";
    WPZOOM_Theme::init();
}
/**
 * Delay `zoom_load_components` function to run after `functions.php` file is
 * executed. This is needed because we load components code iff somewhere is
 * stated that this theme supports a zoom component via `add_theme_support`.
 *
 * In `functions.php` and other code loaded directly by this file we need to
 * wrap access to option values (option::get) into functions that run in
 * `after_setup_theme` action with priority higher than 10, otherwise it will
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:31,代码来源:init.php

示例9: bloginfo

                <?php 
if (!get_theme_mod('hide-tagline')) {
    ?>
                    <p class="tagline"><?php 
    bloginfo('description');
    ?>
</p>
                <?php 
}
?>

            </div><!-- .navbar-brand -->


            <?php 
if (option::is_on('ad_head_select')) {
    ?>
                <div class="adv">

                    <?php 
    if (option::get('ad_head_code') != "") {
        echo stripslashes(option::get('ad_head_code'));
    } else {
        ?>
                        <a href="<?php 
        echo option::get('banner_top_url');
        ?>
"><img src="<?php 
        echo option::get('banner_top');
        ?>
" alt="<?php 
开发者ID:rebekahheacock,项目名称:go324,代码行数:31,代码来源:header.php

示例10: carouFredSel_scripts

function carouFredSel_scripts()
{
    if (!is_home()) {
        return;
    }
    if (get_query_var('paged') && get_query_var('paged') != 1) {
        return;
    }
    if (!option::is_on('featured_posts_show')) {
        return;
    }
    $slider_config = array('slideshow_speed' => intval(option::get('slideshow_speed')), 'autoplay' => option::is_on('slideshow_auto'));
    if (option::is_on('slideshow_auto')) {
        wp_enqueue_script('frogaloop', 'http://a.vimeocdn.com/js/froogaloop2.min.js');
        wp_enqueue_script('youtube-player-api', 'https://www.youtube.com/player_api');
    }
    wp_enqueue_script('touchswipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '1.6.5', true);
    wp_enqueue_script('caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel.js', array('jquery'), '6.2.1', true);
    wp_enqueue_script('featured-slider', get_template_directory_uri() . '/js/jquery.featuredSlider.js', array('touchswipe', 'caroufredsel'), '20140127', true);
    wp_localize_script('featured-slider', 'featured_slider', json_encode($slider_config));
}
开发者ID:MBerguer,项目名称:wp-demo,代码行数:21,代码来源:functions.php

示例11: register_admin_pages

 /**
  * WPZOOM custom menu for wp-admin
  */
 public function register_admin_pages()
 {
     add_object_page('Page Title', 'WPZOOM', 'manage_options', 'wpzoom_options', array($this, 'admin'), 'none');
     add_submenu_page('wpzoom_options', 'WPZOOM', 'Theme Options', 'manage_options', 'wpzoom_options', array($this, 'admin'));
     if (file_exists(get_template_directory() . '/functions/customizer')) {
         $customize_url = add_query_arg('return', urlencode(wp_unslash($_SERVER['REQUEST_URI'])), 'customize.php');
         add_submenu_page('wpzoom_options', 'Customize', 'Customize', 'customize', esc_url($customize_url));
     }
     if (option::is_on('framework_update_enable')) {
         add_submenu_page('wpzoom_options', 'Update Framework', 'Update Framework', 'update_themes', 'wpzoom_update', array($this, 'update'));
     }
     if (option::is_on('framework_newthemes_enable') && !wpzoom::$tf) {
         add_submenu_page('wpzoom_options', 'New Themes', 'New Themes', 'manage_options', 'wpzoom_themes', array($this, 'themes'));
     }
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:18,代码来源:admin.php

示例12: get_header

<?php

get_header();
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
// gets current page number
?>

<?php 
if (is_home() && $paged < 2 && option::is_on('featured_top_display')) {
    get_template_part('wpzoom-featured');
    // Display 4 Featured Posts at the Top
    if (option::get('ad_top_select') == 'on') {
        // Homepage Top Ad
        ?>

		<div class="adv_top">
		<?php 
        if (option::get('ad_top_code') != "") {
            echo stripslashes(option::get('ad_top_code'));
        } else {
            ?>
<a href="<?php 
            echo option::get('banner_top_home_url');
            ?>
"><img src="<?php 
            echo option::get('banner_top_home');
            ?>
" alt="<?php 
            echo option::get('banner_top_home_alt');
            ?>
" /></a><?php 
开发者ID:kahlanamnell,项目名称:alpha,代码行数:31,代码来源:index.php


注:本文中的option::is_on方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。