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 }
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>')); }
/** * 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')); } }
/** * 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); } }
function vc_wpex_remove_vc_scripts() { if (is_customize_preview()) { wp_deregister_script('wpb_composer_front_js'); wp_dequeue_script('wpb_composer_front_js'); } }
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; }
/** * 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); } }
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; }
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; } } }
/** * 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')); } }
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')); } }
/** * 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; }
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')); }
/** * Register widget with WordPress. */ public function __construct() { parent::__construct('twitter_timeline', apply_filters('jetpack_widget_name', esc_html__('Twitter Timeline', 'jetpack')), array('classname' => 'widget_twitter_timeline', 'description' => __('Display an official Twitter Embedded Timeline widget.', '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')); } }
/** * 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')); } }
/** * 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'); }
/** * Working as a group, we get things done better. * * @since 1.0.3 */ public function __construct() { $widget_ops = array('description' => __('A dynamic list of recently active, popular, and newest groups', 'buddypress'), 'classname' => 'widget_bp_groups_widget buddypress widget', 'customize_selective_refresh' => true); parent::__construct(false, _x('(BuddyPress) Groups', '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')); } }
function link_to_customizer() { $ver = defined('THEME_ASSETS_VERSION') ? THEME_ASSETS_VERSION : false; if (!is_customize_preview() && current_user_can('edit_theme_options')) { wp_enqueue_script('skrollr-metadesc-customizer-link', get_template_directory_uri() . '/inc/metadesc/customizer_link.js', array('jquery'), $ver, true); wp_localize_script('skrollr-metadesc-customizer-link', 'customizer_url', admin_url('customize.php')); } }
public function __construct() { parent::__construct('wpcom_social_media_icons_widget', apply_filters('jetpack_widget_name', esc_html__('Social Media Icons', 'jetpack')), array('description' => __('A simple widget that displays social media icons.', 'jetpack'), 'customize_selective_refresh' => true)); $this->defaults = array('title' => __('Social', 'jetpack'), 'facebook_username' => '', 'twitter_username' => '', 'instagram_username' => '', 'pinterest_username' => '', 'linkedin_username' => '', 'github_username' => '', 'youtube_username' => '', 'vimeo_username' => '', 'googleplus_username' => ''); $this->services = array('facebook' => array('Facebook', 'https://www.facebook.com/%s/'), 'twitter' => array('Twitter', 'https://twitter.com/%s/'), 'instagram' => array('Instagram', 'https://instagram.com/%s/'), 'pinterest' => array('Pinterest', 'https://www.pinterest.com/%s/'), 'linkedin' => array('LinkedIn', 'https://www.linkedin.com/in/%s/'), 'github' => array('GitHub', 'https://github.com/%s/'), 'youtube' => array('YouTube', 'https://www.youtube.com/%s/'), 'vimeo' => array('Vimeo', 'https://vimeo.com/%s/'), 'googleplus' => array('Google+', 'https://plus.google.com/u/0/%s/')); if (is_active_widget(false, false, $this->id_base) || is_customize_preview()) { add_action('wp_enqueue_scripts', array($this, 'enqueue_style')); } }
/** * Add CSS in <head> for styles handled by the theme customizer * If the Customizer is active pull in the raw css. Otherwise pull in the prepared theme_mods if they exist. * * @since 2.1.0 * @return void */ public function add_customizer_css() { $storefront_woocommerce_extension_styles = get_theme_mod('storefront_woocommerce_extension_styles'); if (is_customize_preview() || defined('WP_DEBUG') && true === WP_DEBUG || false === $storefront_woocommerce_extension_styles) { wp_add_inline_style('storefront-woocommerce-style', $this->get_woocommerce_extension_css()); } else { wp_add_inline_style('storefront-woocommerce-style', $storefront_woocommerce_extension_styles); } }
/** * Initialize our Customizer settings and controls. * * @since 1.0.0 */ public function customizer_init() { if (!is_customize_preview()) { return; } require_once ALCATRAZ_DESIGNER_PATH . 'classes/class-alcatraz-designer-customize.php'; $alcatraz_designer_customize = new Alcatraz_Designer_Customize(); $alcatraz_designer_customize->init(); }
/** * Constructor * * @return void **/ function __construct() { $widget_ops = array('classname' => 'widget_contact_info', 'description' => __('Display your location, hours, and contact information.', 'jetpack'), 'customize_selective_refresh' => true); parent::__construct('widget_contact_info', apply_filters('jetpack_widget_name', __('Contact Info', 'jetpack')), $widget_ops); $this->alt_option_name = 'widget_contact_info'; if (is_customize_preview()) { add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); } }
function __construct() { parent::__construct('wpcom-goodreads', apply_filters('jetpack_widget_name', __('Goodreads', 'jetpack')), array('classname' => 'widget_goodreads', 'description' => __('Display your books from Goodreads', 'jetpack'), 'customize_selective_refresh' => true)); // For user input sanitization and display $this->shelves = array('read' => _x('Read', 'past participle: books I have read', 'jetpack'), 'currently-reading' => __('Currently Reading', 'jetpack'), 'to-read' => _x('To Read', 'my list of books to read', 'jetpack')); if (is_active_widget('', '', 'wpcom-goodreads') || is_customize_preview()) { add_action('wp_print_styles', array($this, 'enqueue_style')); } }
/** * Sets up a new Recent Comments widget instance. * * @since 2.8.0 * @access public */ public function __construct() { $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __('Your site’s most recent comments.'), 'customize_selective_refresh' => true); parent::__construct('recent-comments', __('Recent Comments'), $widget_ops); $this->alt_option_name = 'widget_recent_comments'; if (is_active_widget(false, false, $this->id_base) || is_customize_preview()) { add_action('wp_head', array($this, 'recent_comments_style')); } }
/** * Adds custom classes to the array of body classes. * * @since vantage 1.0 */ function vantage_body_classes($classes) { // Adds a class of group-blog to blogs with more than 1 published author if (is_multi_author()) { $classes[] = 'group-blog'; } if (siteorigin_setting('layout_responsive')) { $classes[] = 'responsive'; } $classes[] = 'layout-' . siteorigin_setting('layout_bound'); $classes[] = 'no-js'; $is_full_width_template = is_page_template('templates/template-full.php') || is_page_template('templates/template-full-notitle.php'); if (!$is_full_width_template) { $wc_shop_sidebar = vantage_is_woocommerce_active() && is_shop() && is_active_sidebar('shop'); if (!is_active_sidebar('sidebar-1') && !$wc_shop_sidebar) { $classes[] = 'no-sidebar'; } else { $classes[] = 'has-sidebar'; } } if (is_customize_preview()) { $classes[] = 'so-vantage-customizer-preview'; } if (wp_is_mobile()) { $classes[] = 'so-vantage-mobile-device'; } $mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary'); if (siteorigin_setting('navigation_menu_search') && !$mega_menu_active) { $classes[] = 'has-menu-search'; } if (siteorigin_setting('layout_force_panels_full')) { $classes[] = 'panels-style-force-full'; } $page_settings = siteorigin_page_setting(); if (!empty($page_settings)) { if (!empty($page_settings['layout'])) { $classes[] = 'page-layout-' . $page_settings['layout']; } if (empty($page_settings['masthead_margin'])) { $classes[] = 'page-layout-no-masthead-margin'; } if (empty($page_settings['footer_margin'])) { $classes[] = 'page-layout-no-footer-margin'; } if (!empty($page_settings['hide_masthead'])) { $classes[] = 'page-layout-hide-masthead'; } if (!empty($page_settings['hide_footer_widgets'])) { $classes[] = 'page-layout-hide-footer-widgets'; } } if (is_page() && is_page_template()) { $classes[] = 'not-default-page'; } return $classes; }
public function __construct() { if (is_admin() || is_customize_preview()) { return; } add_filter('print_styles_array', array($this, 'process_styles'), 1000); add_filter('print_scripts_array', array($this, 'process_scripts'), 1000); add_filter('style_loader_src', array($this, 'replace_style_source'), 1, 2); add_filter('script_loader_src', array($this, 'replace_script_source'), 1, 2); }
function __construct() { parent::__construct('grofile', apply_filters('jetpack_widget_name', __('Gravatar Profile', 'jetpack')), array('classname' => 'widget-grofile grofile', 'description' => __('Display a mini version of your Gravatar Profile', 'jetpack'), 'customize_selective_refresh' => true)); if (is_admin()) { add_action('admin_footer-widgets.php', array($this, 'admin_script')); } if (is_customize_preview()) { add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); } }
function screenr_is_selective_refresh() { $check = isset($GLOBALS['screenr_is_selective_refresh']) && $GLOBALS['screenr_is_selective_refresh'] ? true : false; if (!$check) { if (is_customize_preview() && isset($_POST['partials'])) { $check = true; } } return $check; }
/** * Constructor method. * * @since 1.5.0 */ public function __construct() { // Setup widget name & description. $name = _x('(BuddyPress) Members', 'widget name', 'buddypress'); $description = __('A dynamic list of recently active, popular, and newest members', 'buddypress'); // Call WP_Widget constructor. parent::__construct(false, $name, array('description' => $description, 'classname' => 'widget_bp_core_members_widget buddypress widget', 'customize_selective_refresh' => true)); if (is_customize_preview() || is_active_widget(false, false, $this->id_base)) { add_action('bp_enqueue_scripts', array($this, 'enqueue_scripts')); } }
function __construct() { $this->min_width = min($this->min_width_portrait, $this->min_width_landscape); $this->allowed_types = array('person' => __('Person Widget', 'jetpack'), 'page' => __('Page Widget', 'jetpack'), 'community' => __('Community Widget', 'jetpack')); parent::__construct('googleplus-badge', apply_filters('jetpack_widget_name', __('Google+ Badge', 'jetpack')), array('classname' => 'widget_googleplus_badge', 'description' => __('Display a Google+ Badge to connect visitors to your Google+', 'jetpack'), 'customize_selective_refresh' => true)); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts')); if (is_active_widget('', '', 'googleplus-badge') || is_customize_preview()) { add_action('wp_print_styles', array($this, 'enqueue_script')); add_filter('script_loader_tag', array($this, 'replace_script_tag'), 10, 2); } }