當前位置: 首頁>>代碼示例>>PHP>>正文


PHP is_customize_preview函數代碼示例

本文整理匯總了PHP中is_customize_preview函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_customize_preview函數的具體用法?PHP is_customize_preview怎麽用?PHP is_customize_preview使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了is_customize_preview函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Brand

function Brand()
{
    ?>
  <div class="brand">
    <h1 class="brand__title"><a href="<?php 
    echo esc_url(home_url('/'));
    ?>
" rel="home"><?php 
    bloginfo('name');
    ?>
</a></h1>
    <?php 
    $description = get_bloginfo('description', 'display');
    if ($description || is_customize_preview()) {
        ?>
      <span class="brand__description"><?php 
        echo $description;
        /* WPCS: xss ok. */
        ?>
</span>
    <?php 
    }
    ?>
  </div>
<?php 
}
開發者ID:gios-asu,項目名稱:bemmy-wordpress-theme,代碼行數:26,代碼來源:Brand.php

示例2: optimizer_widgets_init

function optimizer_widgets_init()
{
    $editbutton = is_customize_preview() ? '<a class="edit_widget" title="Edit Widget - #%1$s"><i class="fa fa-pencil"></i></a>' : '';
    register_sidebar(array('name' => __('Right Sidebar', 'optimizer'), 'id' => 'sidebar', 'description' => __('When you assign widgets to this area, it will be displayed on the right side of all pages and posts', 'optimizer'), 'before_widget' => '<div id="%1$s" class="widget %2$s" data-widget-id="%1$s"><div class="widget_wrap">' . $editbutton, 'after_widget' => '<span class="widget_corner"></span></div></div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Footer Widgets', 'optimizer'), 'id' => 'foot_sidebar', 'description' => __('This Widget Area is displayed in the footer section of your site.', 'optimizer'), 'before_widget' => '<li id="%1$s" class="widget %2$s" data-widget-id="%1$s"><div class="widget_wrap">' . $editbutton, 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Frontpage Widgets', 'optimizer'), 'id' => 'front_sidebar', 'description' => __('With Optmizer Free you can only add 4 widgets to this Area. Upgrade to PRO to add unlimited Widgets.', 'optimizer'), 'before_widget' => '<div id="%1$s" class="widget %2$s" data-widget-id="%1$s"><div class="widget_wrap">' . $editbutton, 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
}
開發者ID:danaevernden,項目名稱:danaeverndenWP,代碼行數:7,代碼來源:core.php

示例3: __construct

 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('image', apply_filters('jetpack_widget_name', esc_html__('Image', 'jetpack')), array('classname' => 'widget_image', 'description' => __('Display an image in your sidebar', 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster') || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_style'));
     }
 }
開發者ID:jordankoschei,項目名稱:jordankoschei-dot-com,代碼行數:10,代碼來源:image-widget.php

示例4: alcatraz_output_site_description

/**
 * Output the site description.
 *
 * @since  1.0.0
 */
function alcatraz_output_site_description()
{
    $description = get_bloginfo('description', 'display');
    if ($description || is_customize_preview()) {
        printf('<p class="%s">%s</p>', 'site-description', $description);
    }
}
開發者ID:BraadMartin,項目名稱:Alcatraz,代碼行數:12,代碼來源:theme-hooks.php

示例5: vc_wpex_remove_vc_scripts

 function vc_wpex_remove_vc_scripts()
 {
     if (is_customize_preview()) {
         wp_deregister_script('wpb_composer_front_js');
         wp_dequeue_script('wpb_composer_front_js');
     }
 }
開發者ID:rovak73,項目名稱:sinfronterasdoc,代碼行數:7,代碼來源:wp_customize.php

示例6: widget

 function widget($args, $instance)
 {
     extract($args);
     /* Our variables from the widget settings. */
     $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : __('THE OPTIMIZER', 'optimizer');
     $subtitle = isset($instance['subtitle']) ? apply_filters('widget_title', $instance['subtitle']) : __('a little about..', 'optimizer');
     $content = isset($instance['content']) ? apply_filters('wp_editor_widget_content', $instance['content']) : '<p>' . __('Collaboratively administrate empowered markets via plug-and-play networks. Dynamically procrastinate B2C users after installed base benefits. Dramatically visualize customer directed convergence without revolutionary ROI.', 'optimizer') . '</p>';
     $divider = isset($instance['divider']) ? apply_filters('widget_title', $instance['divider']) : 'fa-stop';
     $title_color = isset($instance['title_color']) ? $instance['title_color'] : '#222222';
     $content_color = isset($instance['content_color']) ? $instance['content_color'] : '#a8b4bf';
     $content_bg = isset($instance['content_bg']) ? $instance['content_bg'] : '#ffffff';
     /* Before widget (defined by themes). */
     echo $before_widget;
     if (is_customize_preview()) {
         echo '<span class="widgetname">' . $this->name . '</span>';
     }
     echo '<div class="text_block_wrap"><div class="center"><div class="about_inner">';
     if (isset($subtitle)) {
         echo '<span class="about_pre">' . do_shortcode($subtitle) . '</span>';
     }
     if (!empty($title)) {
         echo '<h1 class="about_header">' . do_shortcode($title) . '</h1>';
     }
     if ($divider) {
         if ($divider !== 'no_divider') {
             echo '<div class="optimizer_divider"><span class="div_left"></span><span class="div_middle"><i class="fa ' . $divider . '"></i></span><span class="div_right"></span></div>';
         }
     }
     if ($content) {
         echo '<div class="about_content">' . do_shortcode($content) . '</div>';
     }
     echo '</div></div></div>';
     /* After widget (defined by themes). */
     echo $after_widget;
 }
開發者ID:pbhanu1994,項目名稱:bhanuprakash,代碼行數:35,代碼來源:front-about.php

示例7: __construct

 /**
  * Main constructor
  *
  * @since 1.6.0
  */
 public function __construct()
 {
     // Get customizer enabled panels
     $enabled_panels = get_option('wpex_customizer_panels', array('typography' => true));
     // Customizer actions
     if (isset($enabled_panels['typography'])) {
         add_action('customize_register', array($this, 'register'), 40);
     }
     // Add fonts to the mce editor
     add_action('admin_init', array($this, 'mce_scripts'));
     add_filter('tiny_mce_before_init', array($this, 'mce_fonts'));
     // Load Google Font scripts
     if (wpex_get_mod('google_fonts_in_footer')) {
         add_action('wp_footer', array($this, 'load_fonts'));
     } else {
         add_action('wp_enqueue_scripts', array($this, 'load_fonts'));
     }
     // CSS output
     if (is_customize_preview() && isset($enabled_panels['typography'])) {
         add_action('customize_preview_init', array($this, 'customize_preview_init'));
         add_action('wp_head', array($this, 'live_preview_styles'), 999);
     } else {
         add_filter('wpex_head_css', array($this, 'head_css'), 99);
     }
 }
開發者ID:iq007,項目名稱:MadScape,代碼行數:30,代碼來源:typography.php

示例8: get

 public function get($option_id, $default = '')
 {
     static $cached_options = array();
     if (in_array($option_id, $this->keys()) && isset($_GET[$option_id])) {
         return $_GET[$option_id];
     }
     if (isset($cached_options[$option_id]) && !is_customize_preview()) {
         return $cached_options[$option_id];
     }
     $ot_keys = apply_filters('youxi_option_ot_keys', array());
     $ot_on_off = apply_filters('youxi_option_ot_on_off', array());
     if (in_array($option_id, $ot_keys)) {
         if (in_array($option_id, $ot_on_off)) {
             $return = 'on' === ot_get_option($option_id, $default);
         } else {
             $return = ot_get_option($option_id, $default);
         }
     } else {
         $defaults = $this->defaults();
         $options = $this->get_all();
         if (isset($options[$option_id])) {
             $return = $options[$option_id];
         } elseif (isset($defaults[$option_id])) {
             $return = $defaults[$option_id];
         } else {
             $return = $default;
         }
     }
     return $cached_options[$option_id] = $return;
 }
開發者ID:yemingyuen,項目名稱:mingsg,代碼行數:30,代碼來源:class-option.php

示例9: pagelines_check_install

 function pagelines_check_install()
 {
     $install = false;
     $url = add_query_arg(array('edtr' => 'on', 'toolbox' => 'open'), site_url());
     if (isset($_REQUEST['pl-install-theme']) && !pl_is_wporg()) {
         $install = true;
     }
     if (is_admin()) {
         global $pagenow;
         if (is_customize_preview()) {
             return false;
         }
         if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && !pl_is_wporg()) {
             $install = true;
         }
         if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && pl_is_wporg()) {
             add_action('admin_notices', array($this, 'install_notice'));
             $install = false;
         }
         if (pl_is_wporg() && isset($_REQUEST['i-love-wporg'])) {
             $install = true;
         }
     }
     if ($install == true) {
         // Simon why do we need this??
         if (get_theme_mod('pl_installed')) {
             wp_redirect($url);
             exit;
         } else {
             $url = $this->run_installation_routine();
             wp_redirect($url);
             exit;
         }
     }
 }
開發者ID:taeche,項目名稱:SoDoEx,代碼行數:35,代碼來源:init.install.php

示例10: __construct

 /**
  * Constructor.
  *
  * @since Twenty Fourteen 1.0
  *
  * @return Twenty_Fourteen_Ephemera_Widget
  */
 public function __construct()
 {
     parent::__construct('widget_twentyfourteen_ephemera', __('Twenty Fourteen Ephemera', 'twentyfourteen'), array('classname' => 'widget_twentyfourteen_ephemera', 'description' => __('Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
開發者ID:SayenkoDesign,項目名稱:ividf,代碼行數:14,代碼來源:widgets.php

示例11: __construct

 function __construct()
 {
     parent::__construct('facebook-likebox', apply_filters('jetpack_widget_name', __('Facebook Page Plugin', 'jetpack')), array('classname' => 'widget_facebook_likebox', 'description' => __('Use the Facebook Page Plugin to connect visitors to your Facebook Page', 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster') || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
開發者ID:pcuervo,項目名稱:wp-carnival,代碼行數:7,代碼來源:facebook-likebox.php

示例12: capture_customizer_page

 /**
  * Here we capture the page and show template acordingly
  * @param $template
  *
  * @return string
  */
 public function capture_customizer_page($template)
 {
     if (is_customize_preview() && isset($_GET['mailtpl_display']) && 'true' == $_GET['mailtpl_display']) {
         return apply_filters('mailtpl/customizer_template', MAILTPL_PLUGIN_DIR . "/admin/templates/default.php");
     }
     return $template;
 }
開發者ID:eliorivero,項目名稱:wordpress-email-templates,代碼行數:13,代碼來源:class-mailtpl-customizer.php

示例13: __construct

 function __construct()
 {
     $this->load_files();
     // TEMPLATE ACTIONS
     // !important - must load after $post variable
     // ALSO, bbPress and other plugins make adjustments to queries which change pages from 404 to something else.
     // Therefore must come after WP_Query (parse query)
     // workaround for customizer in WP >4.3
     // default was 'wp' but customizer needs the libs loaded on 'init'
     if (is_customize_preview()) {
         $hook = 'init';
     } else {
         $hook = 'wp';
     }
     add_action($hook, array($this, 'load_libs'), 10);
     add_action('admin_init', array($this, 'load_libs'), 5);
     add_filter('parse_request', array($this, 'check_for_type'));
     add_action('wp_enqueue_scripts', array($this, 'process_styles'));
     add_action('wp_head', array($this, 'process_head'));
     add_action('wp_footer', array($this, 'process_foot'));
     // RENDER SECTION TEMPLATES ACTIONS
     add_action('pagelines_fixed', array($this, 'process_fixed'));
     add_action('pagelines_header', array($this, 'process_header'));
     add_action('pagelines_template', array($this, 'process_template'));
     add_action('pagelines_footer', array($this, 'process_footer'));
 }
開發者ID:taeche,項目名稱:SoDoEx,代碼行數:26,代碼來源:init.editor.php

示例14: __construct

 /**
  * Class constructor.
  *
  * @since 1.9.0
  */
 function __construct()
 {
     $widget_ops = array('description' => __('A dynamic list of recently active, popular, and newest Friends of the displayed member.  Widget is only shown when viewing a member profile.', 'buddypress'), 'classname' => 'widget_bp_core_friends_widget buddypress widget', 'customize_selective_refresh' => true);
     parent::__construct(false, $name = _x('(BuddyPress) Friends', 'widget name', 'buddypress'), $widget_ops);
     if (is_customize_preview() || is_active_widget(false, false, $this->id_base)) {
         add_action('bp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
開發者ID:CompositeUK,項目名稱:clone.BuddyPress,代碼行數:13,代碼來源:class-bp-core-friends-widget.php

示例15: __construct

 /**
  * Registers the widget with WordPress.
  */
 function __construct()
 {
     parent::__construct('jetpack_my_community', apply_filters('jetpack_widget_name', esc_html__('My Community', 'jetpack')), array('description' => esc_html__("Display members of your site's community.", 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster') || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_style'));
     }
     $this->default_title = esc_html__('Community', 'jetpack');
 }
開發者ID:automattic,項目名稱:jetpack,代碼行數:11,代碼來源:my-community.php


注:本文中的is_customize_preview函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。