本文整理汇总了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
}
示例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>'));
}
示例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'));
}
}
示例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);
}
}
示例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');
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
示例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'));
}
}
示例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'));
}
}
示例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;
}
示例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'));
}
示例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'));
}
}
示例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');
}