Пример #1
0
/**
 * Register the default framework sidebars. Theme developers may optionally 
 * choose to support these sidebars within their themes or add more custom 
 * sidebars to the mix.
 *
 * @since 0.0.1
 * @uses register_sidebar() Registers a sidebar with WordPress.
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 */
function pls_register_sidebars()
{
    /** Get theme-supported sidebars. */
    $sidebar_support = get_theme_support('pls-sidebars');
    /** If there is no array of sidebars IDs, return. */
    if (!is_array($sidebar_support[0])) {
        return;
    }
    /** Set up the default sidebar arguments. */
    if (get_theme_support('pls-main-sidebar')) {
        $sidebars[] = array('id' => 'primary', 'name' => 'Default Sidebar', 'description' => 'The main (primary) widget area, most often used as a sidebar on pages that do not have a custom sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-home-sidebar')) {
        $sidebars[] = array('id' => 'home', 'name' => 'Home Page', 'description' => 'The home page widget area, most often used as a sidebar on pages that do not have a custom sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-listings-search-sidebar')) {
        $sidebars[] = array('id' => 'listings-search', 'name' => 'Listings Search Sidebar', 'description' => 'The main (primary) widget area, most often used as a sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-single-property-sidebar')) {
        $sidebars[] = array('id' => 'single-property', 'name' => 'Single Property Sidebar', 'description' => 'Widget area displayed on single property details page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    /** Set up other sidebar arguments to be available on request. */
    if (get_theme_support('pls-rental-search-sidebar')) {
        $sidebars[] = array('id' => 'rental-search', 'name' => 'Rental Search Sidebar', 'description' => 'Widget area displayed on Rental Search page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-sales-search-sidebar')) {
        $sidebars[] = array('id' => 'sales-search', 'name' => 'Sales Search Sidebar', 'description' => 'Widget area displayed on Sales Search page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-contact-sidebar')) {
        $sidebars[] = array('id' => 'contact', 'name' => 'Contact Page Sidebar', 'description' => 'Widget area displayed on Contact page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-blog-index-sidebar')) {
        $sidebars[] = array('id' => 'blog-index', 'name' => 'Blog Index Sidebar', 'description' => 'Widget area displayed on Blog Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-single-post-sidebar')) {
        $sidebars[] = array('id' => 'single-post', 'name' => 'Single Blog Post Sidebar', 'description' => 'Widget area displayed on single blog post page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-neighborhoods-sidebar')) {
        $sidebars[] = array('id' => 'neighborhoods', 'name' => 'Neighborhoods Page Sidebar', 'description' => 'Widget area displayed on Neighborhoods Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-single-neighborhood-sidebar')) {
        $sidebars[] = array('id' => 'single-neighborhood', 'name' => 'Single Neighborhood Sidebar', 'description' => 'Widget area displayed on single neighborhood details page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-testimonials-sidebar')) {
        $sidebars[] = array('id' => 'testimonials', 'name' => 'Testimonials Page Sidebar', 'description' => 'Widget area displayed on Testimonials Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-agents-sidebar')) {
        $sidebars[] = array('id' => 'agents', 'name' => 'Agents Page Sidebar', 'description' => 'Widget area displayed on Agents Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    if (get_theme_support('pls-services-sidebar')) {
        $sidebars[] = array('id' => 'services', 'name' => 'Services Page Sidebar', 'description' => 'Widget area displayed on Services Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
    }
    // pls_dump($sidebar_support);
    // loop through and create sidebars
    foreach ($sidebars as $sidebar) {
        if (in_array($sidebar['id'], $sidebar_support[0])) {
            register_sidebar($sidebar);
        }
    }
}
Пример #2
0
    /**
     * Creates the tag for header image
     */
    function franz_header_image()
    {
        $header = get_custom_header();
        if ($header->url) {
            /* Scale hidpi header image */
            $custom_header = get_theme_support('custom-header');
            $header_args = array_pop($custom_header);
            if ($header->width >= 2 * $header_args['width']) {
                $header->width = floor($header->width / 2);
                $header->height = floor($header->height / 2);
            }
            ?>
       <img class="img-responsive" src="<?php 
            echo esc_url($header->url);
            ?>
" height="<?php 
            echo esc_attr($header->height);
            ?>
" width="<?php 
            echo esc_attr($header->width);
            ?>
" alt="" /> 
         
    <?php 
        } else {
            bloginfo('name');
        }
    }
Пример #3
0
 function mh_newsdesk_lite_logo()
 {
     $header_img = get_header_image();
     $header_title = get_bloginfo('name');
     $header_desc = get_bloginfo('description');
     echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n";
     echo '<div class="logo-wrap" role="banner">' . "\n";
     if ($header_img) {
         echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n";
     }
     if (0 && display_header_text()) {
         $text_color = get_header_textcolor();
         if ($text_color != get_theme_support('custom-header', 'default-text-color')) {
             echo '<style type="text/css" id="mh-header-css">';
             echo '.logo-title, .logo-tagline { color: #' . esc_attr($text_color) . '; }';
             echo '</style>' . "\n";
         }
         echo '<div class="logo">' . "\n";
         if ($header_title) {
             echo '<h1 class="logo-title">' . esc_attr($header_title) . '</h1>' . "\n";
         }
         if ($header_desc) {
             echo '<h2 class="logo-tagline">' . esc_attr($header_desc) . '</h2>' . "\n";
         }
         echo '</div>' . "\n";
     }
     echo '</div>' . "\n";
     echo '</a>' . "\n";
 }
Пример #4
0
/**
 * Echo the markup necessary to facilitate the footer widget areas.
 *
 * Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
 *
 * The child theme must style the widget areas.
 *
 * Applies the `genesis_footer_widget_areas` filter.
 *
 * @since 1.6.0
 *
 * @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
 *
 * @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
 */
function genesis_footer_widget_areas()
{
    $footer_widgets = get_theme_support('genesis-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    //* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $inside = '';
    $output = '';
    $counter = 1;
    while ($counter <= $footer_widgets) {
        //* Darn you, WordPress! Gotta output buffer.
        ob_start();
        dynamic_sidebar('footer-' . $counter);
        $widgets = ob_get_clean();
        if ($widgets) {
            $inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
        }
        $counter++;
    }
    if ($inside) {
        $output .= genesis_markup(array('html5' => '<div %s>' . genesis_sidebar_title('Footer'), 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets', 'echo' => false));
        $output .= genesis_structural_wrap('footer-widgets', 'open', 0);
        $output .= $inside;
        $output .= genesis_structural_wrap('footer-widgets', 'close', 0);
        $output .= '</div>';
    }
    echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
 public function initialize()
 {
     $this->user = new stdClass();
     if (is_user_logged_in()) {
         /* Populate settings we need for the menu based on the current user. */
         $this->user->blogs = get_blogs_of_user(get_current_user_id());
         if (is_multisite()) {
             $this->user->active_blog = get_active_blog_for_user(get_current_user_id());
             $this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
             $this->user->account_domain = $this->user->domain;
         } else {
             $this->user->active_blog = $this->user->blogs[get_current_blog_id()];
             $this->user->domain = trailingslashit(home_url());
             $this->user->account_domain = $this->user->domain;
         }
     }
     add_action('wp_head', 'wp_admin_bar_header');
     add_action('admin_head', 'wp_admin_bar_header');
     if (current_theme_supports('admin-bar')) {
         $admin_bar_args = get_theme_support('admin-bar');
         // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
         $header_callback = $admin_bar_args[0]['callback'];
     }
     if (empty($header_callback)) {
         $header_callback = '_admin_bar_bump_cb';
     }
     add_action('wp_head', $header_callback);
     wp_enqueue_script('admin-bar');
     wp_enqueue_style('admin-bar');
     do_action('admin_bar_init');
 }
 function cfpf_init()
 {
     $this->post_formats = get_theme_support('post-formats');
     if (!empty($this->post_formats[0]) && is_array($this->post_formats[0])) {
         if (in_array('gallery', $this->post_formats[0])) {
             //out('gallery');
             add_action('save_post', array($this, 'postformat_gallery_save_post'));
         }
         if (in_array('link', $this->post_formats[0])) {
             //out('link');
             add_action('save_post', array($this, 'postformat_link_save_post'));
         }
         if (in_array('status', $this->post_formats[0])) {
             //out('status');
             add_action('save_post', array($this, 'postformat_status_save_post'), 10, 2);
         }
         if (in_array('quote', $this->post_formats[0])) {
             //out('quote');
             add_action('save_post', array($this, 'postformat_quote_save_post'), 10, 2);
         }
         if (in_array('video', $this->post_formats[0])) {
             //out('video');
             add_action('save_post', array($this, 'postformat_video_save_post'));
         }
         if (in_array('audio', $this->post_formats[0])) {
             //out('gallery');
             add_action('save_post', array($this, 'postformat_audio_save_post'));
         }
     }
 }
Пример #7
0
function reactor_register_sidebars()
{
    $sidebars = get_theme_support('reactor-sidebars');
    if (!is_array($sidebars[0])) {
        return;
    }
    if (in_array('primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Primary Sidebar', 'reactor'), 'id' => 'sidebar', 'description' => 'The primary sidebar for 2 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Secondary Sidebar', 'reactor'), 'id' => 'sidebar-2', 'description' => 'The secondary sidebar for 3 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Primary', 'reactor'), 'id' => 'sidebar-frontpage', 'description' => 'Primary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Secondary', 'reactor'), 'id' => 'sidebar-frontpage-2', 'description' => 'Secondary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('footer', $sidebars[0])) {
        $footer = '<div id="%1$s" class="widget top-bar-widget ';
        $footer .= 'large-' . reactor_get_widget_columns('sidebar-footer');
        $footer .= ' columns %2$s">';
        register_sidebar(array('name' => __('Footer', 'reactor'), 'id' => 'sidebar-footer', 'description' => 'Footer widget area', 'class' => '', 'before_widget' => $footer, 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
}
 function mh_logo()
 {
     $header_img = get_header_image();
     $header_title = get_bloginfo('name');
     $header_desc = get_bloginfo('description');
     echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n";
     echo '<div class="logo-wrap" role="banner">' . "\n";
     if ($header_img) {
         echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n";
     }
     if (display_header_text()) {
         $header_img ? $logo_pos = 'logo-overlay' : ($logo_pos = 'logo-text');
         $text_color = get_header_textcolor();
         if ($text_color != get_theme_support('custom-header', 'default-text-color')) {
             echo '<style type="text/css" id="mh-header-css">';
             echo '.logo-name, .logo-desc { color: #' . esc_attr($text_color) . '; }';
             echo '.logo-name { border-bottom: 3px solid #' . esc_attr($text_color) . '; }';
             echo '</style>' . "\n";
         }
         echo '<div class="logo ' . $logo_pos . '">' . "\n";
         if ($header_title) {
             echo '<h1 class="logo-name">' . esc_attr($header_title) . '</h1>' . "\n";
         }
         if ($header_desc) {
             echo '<h2 class="logo-desc">' . esc_attr($header_desc) . '</h2>' . "\n";
         }
         echo '</div>' . "\n";
     }
     echo '</div>' . "\n";
     echo '</a>' . "\n";
 }
Пример #9
0
/**
 * Fonts Customizer Label
 */
function tamatebako_fonts_label()
{
    $defaults = array('fonts' => 'Fonts');
    $theme_support = get_theme_support('tamatebako-custom-fonts');
    $args = isset($theme_support[2]) ? $theme_support[2] : array();
    return wp_parse_args($args, $defaults);
}
Пример #10
0
    /**
     * Styles the header image and text displayed on the blog
     *
     * @see upbootwp_custom_header_setup().
     */
    function upbootwp_header_style()
    {
        $header_image = get_header_image();
        $text_color = get_header_textcolor();
        // If no custom options for text are set, let's bail.
        if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) {
            return;
        }
        // If we get this far, we have custom styles.
        ?>
	<style type="text/css" id="upbootwp-header-css">
	<?php 
        if (!empty($header_image)) {
            ?>
		.site-header {
			background: url(<?php 
            header_image();
            ?>
) no-repeat scroll top;
			background-size: 1600px auto;
			height:<?php 
            echo header_image()->height;
            ?>
px;
		}
	<?php 
        }
        // Has the text been hidden?
        if (!display_header_text()) {
            ?>
		.site-title,
		.site-description {
			position: absolute;
			clip: rect(1px 1px 1px 1px); /* IE7 */
			clip: rect(1px, 1px, 1px, 1px);
		}
	<?php 
            if (empty($header_image)) {
                ?>
		.site-header .home-link {
			min-height: 0;
		}
	<?php 
            }
            // If the user has set a custom color for the text, use that.
        } elseif ($text_color != get_theme_support('custom-header', 'default-text-color')) {
            ?>
		.site-title,
		.site-description {
			color: #<?php 
            echo esc_attr($text_color);
            ?>
;
		}
	<?php 
        }
        ?>
	</style>
	<?php 
    }
Пример #11
0
    /**
     * Styles the header image and text displayed on the blog
     *
     * @author	Automattic
     * @since	1.2.0 - 05.04.2012
     * 
     * @return	void
     */
    function circleflip_header_style()
    {
        // If no custom options for text are set, let's bail
        // get_header_textcolor() options: get_theme_support( 'custom-header', 'default-text-color' ) is default, hide text (returns 'blank') or any hex value
        if (get_theme_support('custom-header', 'default-text-color') != get_header_textcolor()) {
            ?>
	<style type="text/css">
		<?php 
            if ('blank' == get_header_textcolor()) {
                ?>
		#branding hgroup {
			position: absolute !important;
			clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
			clip: rect(1px, 1px, 1px, 1px);
		}
		<?php 
            } else {
                ?>
		#site-description {
			color: #<?php 
                echo get_header_textcolor();
                ?>
 !important;
		}
		<?php 
            }
            ?>
	</style>
	<?php 
        }
    }
 /**
  * Grab the setting element selectors defined in the customize-inline-editing theme support,
  * or provide fallback defaults for themes bundled with Core.
  *
  * @return array
  */
 function get_theme_support()
 {
     $support = get_theme_support('customize-inline-editing');
     if (!empty($support)) {
         $setting_element_selectors = array_shift($support);
     } else {
         $setting_element_selectors = array();
         if ('twentyten' === get_template()) {
             $setting_element_selectors['blogname'] = '#branding a[rel=home]';
             $setting_element_selectors['blogdescription'] = '#site-description';
         } elseif ('twentyeleven' === get_template()) {
             $setting_element_selectors['blogname'] = '#site-title a';
             $setting_element_selectors['blogdescription'] = '#site-description';
         } elseif ('twentytwelve' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentythirteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentyfourteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
         } elseif ('twentyfifteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentysixteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         }
     }
     return $setting_element_selectors;
 }
Пример #13
0
/**
 * Display the footer widget if the footer widget are active.
 */
function calibrefx_do_footer_widgets()
{
    global $wp_registered_sidebars;
    $footer_widgets = get_theme_support('calibrefx-footer-widgets');
    $all_widgets = wp_get_sidebars_widgets();
    //Check if footer widget theme support is activated or is there any widget inside
    if (!$footer_widgets or !isset($all_widgets['footer-widget'])) {
        return;
    }
    $count_footer_widgets = count($all_widgets['footer-widget']);
    if (0 == $count_footer_widgets) {
        return;
    }
    if (current_theme_supports('calibrefx-responsive-style')) {
        $span = 'col-lg-' . strval(floor(12 / $count_footer_widgets)) . ' col-md-' . strval(floor(12 / $count_footer_widgets)) . ' col-sm-12 col-xs-12';
    } else {
        $span = 'col-xs-' . strval(floor(12 / $count_footer_widgets));
    }
    $sidebar = $wp_registered_sidebars['footer-widget'];
    $footer_widget_column = apply_filters('calibrefx_footer_widget_column_span', $span);
    $sidebar['before_widget'] = '<div id="%1$s" class="widget ' . $footer_widget_column . ' %2$s">';
    $sidebar['after_widget'] = '</div>';
    unregister_sidebar('footer-widget');
    register_sidebar($sidebar);
    if (is_active_sidebar('footer-widget')) {
        echo '<div id="footer-widget">';
        calibrefx_put_wrapper('footer-widget', 'open');
        $footer_widget_wrapper_class = apply_filters('footer_widget_wrapper_class', calibrefx_row_class());
        echo '<div class="footer-widget-wrapper"><div class="' . $footer_widget_wrapper_class . '">';
        dynamic_sidebar('footer-widget');
        echo '</div></div><!--end .footer-widget-wrapper -->';
        calibrefx_put_wrapper('footer-widget', 'close');
        echo '</div><!--end #footer-widget-->';
    }
}
function hipword_header_style()
{
    $header_image = get_header_image();
    $text_color = get_header_textcolor();
    // If no custom options for text are set, let's bail.
    if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) {
        return;
    }
    // If we get this far, we have custom styles.
    ?>
<style type="text/css" id="hipword-header-css">
	<?php 
    if (!empty($header_image)) {
        ?>
	.header-top {
		background: url(<?php 
        header_image();
        ?>
);
		background-position: 50% 0;
		background-repeat: no-repeat;
		-webkit-background-size: cover;
		-moz-background-size: cover;
		background-size: cover;
		-o-background-size: cover;
	}?>
	<?php 
    }
    ?>
</style>
<?php 
}
Пример #15
0
function reactor_register_sidebars()
{
    $sidebars = get_theme_support('reactor-sidebars');
    if (!is_array($sidebars[0])) {
        return;
    }
    if (in_array('primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Primary Sidebar', 'reactor'), 'id' => 'sidebar', 'description' => 'Barra esquerra a les pàgines normals (excepte pàgines de categories)', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Secondary Sidebar', 'reactor'), 'id' => 'sidebar-2', 'description' => 'Barra dreta a les pàgines normals (excepte pàgines de categories)', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Primary', 'reactor'), 'id' => 'sidebar-frontpage', 'description' => 'Barra esquerra a la Portada', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Secondary', 'reactor'), 'id' => 'sidebar-frontpage-2', 'description' => 'Barra dreta a la Portada', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('footer', $sidebars[0])) {
        $footer = '<div id="%1$s" class="widget top-bar-widget ';
        $footer .= 'large-' . reactor_get_widget_columns('sidebar-footer');
        $footer .= ' columns %2$s">';
        register_sidebar(array('name' => __('Peu', 'reactor'), 'id' => 'sidebar-footer', 'description' => 'Peu de pàgina', 'class' => '', 'before_widget' => $footer, 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
}
Пример #16
0
/**
 * Echos the markup necessary to facilitate the footer widget areas.
 *
 * Checks for a numerical parameter given when adding theme support - if none is
 * found, then the function returns early.
 *
 * The child theme must style the widget areas.
 *
 * @since 1.6.0
 *
 * @return null Returns early if number of widget areas could not be determined,
 * or nothing is added to the first widget area
 */
function genesis_footer_widget_areas()
{
    $footer_widgets = get_theme_support('genesis-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    /**
     * Check to see if first widget area has widgets. If not,
     * do nothing. No need to check all footer widget areas.
     */
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $output = '';
    $counter = 1;
    while ($counter <= $footer_widgets) {
        /** Darn you, WordPress! Gotta output buffer. */
        ob_start();
        dynamic_sidebar('footer-' . $counter);
        $widgets = ob_get_clean();
        $output .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
        $counter++;
    }
    echo apply_filters('genesis_footer_widget_areas', sprintf('<div id="footer-widgets" class="footer-widgets">%2$s%1$s%3$s</div>', $output, genesis_structural_wrap('footer-widgets', 'open', 0), genesis_structural_wrap('footer-widgets', 'close', 0)));
}
Пример #17
0
function reactor_register_menus()
{
    /**
     * Register navigation menus for a theme.
     *
     * @since 1.0.0
     * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
     */
    $menus = get_theme_support('reactor-menus');
    if (!is_array($menus[0])) {
        return;
    }
    if (in_array('top-bar-l', $menus[0])) {
        register_nav_menu('top-bar-l', __('Top Bar Left', 'reactor'));
    }
    if (in_array('top-bar-r', $menus[0])) {
        register_nav_menu('top-bar-r', __('Top Bar Right', 'reactor'));
    }
    if (in_array('main-menu', $menus[0])) {
        register_nav_menu('main-menu', __('Main Menu', 'reactor'));
    }
    if (in_array('footer-links', $menus[0])) {
        register_nav_menu('footer-links', __('Footer Links', 'reactor'));
    }
}
Пример #18
0
/**
 * Displays all registered footer widget areas using a template.
 *
 * @since  1.0.0
 * @uses   locate_template() Load the footer widget template.
 * @return null Return early if there's no theme support.
 */
function flagship_footer_widgets()
{
    // Get the current theme's support for footer widgets.
    $footer_widgets = get_theme_support('flagship-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    // Return early if the first widget area has no widgets.
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    $counter = 1;
    ?>
	<div <?php 
    hybrid_attr('footer-widgets');
    ?>
>
		<div class="wrap">
			<?php 
    while ($counter <= $footer_widgets) {
        ?>
				<?php 
        include locate_template('sidebar/footer-widgets.php');
        ?>
				<?php 
        $counter++;
        ?>
			<?php 
    }
    ?>
		</div>
	</div>
	<?php 
}
 /**
  * Conditionally Hook into WordPress.
  *
  * Themes must declare that they support this module by adding
  * add_theme_support( 'featured-content' ); during after_setup_theme.
  *
  * If no theme support is found there is no need to hook into
  * WordPress. We'll just return early instead.
  *
  * @uses Featured_Content::$max_posts
  */
 public static function init()
 {
     $theme_support = get_theme_support('featured-content');
     // Return early if theme does not support featured content.
     if (!$theme_support) {
         return;
     }
     // An array of named arguments must be passed as
     // the second parameter of add_theme_support().
     if (!isset($theme_support[0])) {
         return;
     }
     // Return early if "featured_content_filter" has not been defined.
     if (!isset($theme_support[0]['featured_content_filter'])) {
         return;
     }
     $filter = $theme_support[0]['featured_content_filter'];
     // Themes can override the number of max posts.
     if (isset($theme_support[0]['max_posts'])) {
         self::$max_posts = absint($theme_support[0]['max_posts']);
     }
     add_filter($filter, array(__CLASS__, 'get_featured_posts'));
     add_action('admin_init', array(__CLASS__, 'register_setting'));
     add_action('save_post', array(__CLASS__, 'delete_transient'));
     add_action('delete_post_tag', array(__CLASS__, 'delete_post_tag'));
     add_action('pre_get_posts', array(__CLASS__, 'pre_get_posts'));
     // Hide "featured" tag from the front-end.
     if (self::get_setting('hide-tag')) {
         add_filter('get_terms', array(__CLASS__, 'hide_featured_term'), 10, 2);
         add_filter('get_the_terms', array(__CLASS__, 'hide_the_featured_term'), 10, 3);
     }
 }
 function custom_background()
 {
     $bg_image_url = get_background_image();
     $bg_color = get_background_color();
     // If the user has not defined a background
     // color or a background image, we stop.
     if (!$bg_image_url && !$bg_color) {
         return;
     }
     // If there is only a background color defined,
     // we apply it to <body>, then we stop.
     if (!$bg_image_url && $bg_color) {
         echo '<style>
             body {
                 background-color: #' . $bg_color . ';
             }
         </style>';
         return;
     }
     echo '<style>
         body {
             background-color: #' . $bg_color . ';
             background-image: url(' . $bg_image_url . ');
             background-repeat: ' . get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat')) . ';
             background-position: ' . get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x')) . ';
             background-attachment: ' . get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment')) . '
         }
     </style>';
 }
 function __construct(&$owner)
 {
     parent::__construct($owner, get_class($this), __('General Settings', XF_TEXTDOMAIN));
     $measures = $this->owner->get_measures();
     $this->options[] = new xtreme_option_bool($this, false, 'responsive', __('Responsive Design:', XF_TEXTDOMAIN), false);
     $this->options[] = new xtreme_option_bool($this, false, 'html5', __('Output HTML5:', XF_TEXTDOMAIN), false);
     $this->options[] = new xtreme_option_numeric($this, false, 'bodyfontsize', __('Body Fontsize:', XF_TEXTDOMAIN), 75, '%', $measures, false, array('%' => array(62.5, 68.75, 75.0, 81.25, 87.5, 100.0)));
     $this->options[] = new xtreme_option_select_pair($this, false, 'layout', __('Layout:', XF_TEXTDOMAIN), 1, array(__('fixed', XF_TEXTDOMAIN), __('flexible', XF_TEXTDOMAIN)));
     $this->options[] = new xtreme_option_numeric($this, false, 'minwidth', __('Minimum Layout Width:', XF_TEXTDOMAIN), 740, 'px', $measures, array('px' => array(100, 2000)), false, false);
     $this->options[] = new xtreme_option_numeric($this, false, 'maxwidth', __('Maximum Layout Width:', XF_TEXTDOMAIN), 80, 'em', $measures, array('em' => array(20, 200), '%' => array(20, 100)), false, false);
     $this->options[] = new xtreme_option_numeric($this, false, 'width', __('Layout Width:', XF_TEXTDOMAIN), 960, 'px', $measures, array('px' => array(100, 2000)), false, false);
     $this->options[] = new xtreme_option_select_pair($this, false, 'layoutalign', __('Alignment:', XF_TEXTDOMAIN), 1, array(__('left', XF_TEXTDOMAIN), __('center', XF_TEXTDOMAIN), __('right', XF_TEXTDOMAIN)));
     $this->options[] = new xtreme_option_select_pair($this, false, 'appearance', __('Design:', XF_TEXTDOMAIN), 0, array(__('blog layout', XF_TEXTDOMAIN), __('full page layout', XF_TEXTDOMAIN)));
     if (current_theme_supports('xtreme-color-styles')) {
         $support = get_theme_support('xtreme-color-styles');
         $colors = $support[0];
         $color_keys = array_keys($colors);
         $this->options[] = new xtreme_option_select_pair($this, false, 'color_styles', __('Color Style:', XF_TEXTDOMAIN), $color_keys[0], $colors);
     } else {
         $this->options[] = new xtreme_option_hidden($this, false, 'color_styles', '', '');
     }
     /*
     $this->options[] = new xtreme_option_select_pair($this, false, 'post_socials', __('Social Bookmark Support on Posts:', XF_TEXTDOMAIN), 'none', array('disabled' => __('disabled', XF_TEXTDOMAIN), 'none' => __('enabled, but not predefined', XF_TEXTDOMAIN), 'option' => __('enabled, predefined globally', XF_TEXTDOMAIN), 'postmeta' => __('enabled, predefined post specific', XF_TEXTDOMAIN)));
     $this->options[] = new xtreme_option_select_pair($this, false, 'post_socials_layout', __('Social Bookmark Layout Placement:', XF_TEXTDOMAIN), 'xtreme_after_single_post', array('xtreme_before_single_post' => __('before the post', XF_TEXTDOMAIN), 'xtreme_after_single_post' => __('after the post', XF_TEXTDOMAIN), 'xtreme_authorbox_inside_vcard' => __('inside author box', XF_TEXTDOMAIN), 'xtreme_after_comments_template' => __('after comments', XF_TEXTDOMAIN), 'xtreme_social_template_tag' =>__('manual template tag', XF_TEXTDOMAIN) ));
     */
     $this->options[] = new xtreme_option_bool($this, false, 'aria_required', __('Activate WAI Aria Roles:', XF_TEXTDOMAIN), false);
     $this->options[] = new xtreme_option_bool($this, false, 'nav_vlist', __('Include YAMLs nav_vlist.css:', XF_TEXTDOMAIN), false);
     $this->options[] = new xtreme_option_description($this, false, 'desc_row', '<em>' . __('If you switch the content position, make sure to check your settings in the layout manager for every layout.', XF_TEXTDOMAIN) . '</em>');
     $this->options[] = new xtreme_option_bool($this, false, 'layout_2', __('Generate Markup with Content at first Position:', XF_TEXTDOMAIN), false);
 }
Пример #22
0
 function create_post_types()
 {
     $postType = array('name' => 'Banner', 'plural' => 'Banners', 'slug' => 'banners');
     $customFields = array();
     $customFields[] = array('name' => 'target_url', 'title' => 'Target URL', 'description' => 'Where a user should be sent when they click on the banner or the call to action button', 'type' => 'text');
     $customFields[] = array('name' => 'cta_text', 'title' => 'Call To Action Text', 'description' => 'The "Call To Action" (text) of the button. Leave this field blank to hide the call to action button.', 'type' => 'text');
     $customFields[] = array('name' => 'css_class', 'title' => 'CSS Class', 'description' => 'Any extra CSS classes that you would like applied to this banner.', 'type' => 'text');
     $this->add_custom_post_type($postType, $customFields);
     //load list of current posts that have featured images
     $supportedTypes = get_theme_support('post-thumbnails');
     //none set, add them just to our type
     if ($supportedTypes === false) {
         add_theme_support('post-thumbnails', array('banner'));
         //for the banner images
     } elseif (is_array($supportedTypes)) {
         $supportedTypes[0][] = 'banner';
         add_theme_support('post-thumbnails', $supportedTypes[0]);
         //for the banner images
     }
     //move featured image box to main column
     add_action('add_meta_boxes', array($this, 'custom_banner_edit_screen'));
     //remove unused meta boxes
     add_action('admin_init', array($this, 'custom_banners_unused_meta'));
     // move the post editor under the other metaboxes
     add_action('add_meta_boxes', array($this, 'reposition_editor_metabox'), 0);
     // enforce correct order of metaboxes
     add_action('admin_init', array($this, 'set_metabox_order'));
 }
Пример #23
0
 function extra_shortcodes()
 {
     $theme_support = get_theme_support('avia-shortcodes');
     if (is_array($theme_support) && !empty($theme_support[0])) {
         $supports = "";
         foreach ($theme_support[0] as $main_key => $supportitem) {
             $supports .= $main_key . ":";
             if (is_array($supportitem)) {
                 $supports .= "{";
                 foreach ($supportitem as $key => $subitem) {
                     $supports .= $key . ": '" . $subitem . "', ";
                 }
                 $supports = rtrim($supports, ', ');
                 $supports .= "}, ";
             } else {
                 $supports .= "'";
                 $supports .= $supportitem;
                 $supports .= "', ";
             }
         }
         $supports = rtrim($supports, ', ');
         echo "\n <script type='text/javascript'>\n /* <![CDATA[ */  \n";
         echo "avia_framework_globals.shortcodes = { {$supports} }; \n /* ]]> */ \n ";
         echo "</script>\n \n ";
     }
 }
Пример #24
0
/**
 * Make gallery shortcode use rectangular size by default
 *
 * Otherwise, it uses 'thumbnail' size as defined in Settings > Media, which by default is square.
 *
 * Basic usage:
 *
 * 		add_theme_support( 'ctfw-gallery-thumb-size', 'custom-size' );
 *
 * Column-specific usage:
 *
 *		add_theme_support( 'ctfw-gallery-thumb-size', array(
 *			'1' => 'large',					// use this size when 1 column
 *			'2' => 'custom-size',	 		// use this size when 2 columns
 *			'3' => 'another-custom-size', 	// use this size when 3 columns
 *			'9' => 'other-custom-size',  	// use this size when any other number of columns used
 *		) );
 *
 * @since 0.9
 */
function ctfw_gallery_thumb_size($out, $pairs, $atts)
{
    // Always use size specifically set on shortcode
    if (!empty($atts['size'])) {
        return $out;
    }
    // Use custom size based on column only if theme supports it
    $support = $support = get_theme_support('ctfw-gallery-thumb-size');
    if (!empty($support[0])) {
        $sizes = $support[0];
        // Single size specified
        if (!is_array($sizes)) {
            $out['size'] = $sizes;
        } else {
            // Sort highest column to lowest
            krsort($sizes);
            // Number of columns showing based on shortcode attribute or default
            $columns = !empty($atts['columns']) ? $atts['columns'] : $pairs['columns'];
            // Loop sizes to set most appropriate
            foreach ($sizes as $size_column => $size) {
                if ($columns <= $size_column) {
                    $out['size'] = $size;
                }
            }
        }
    }
    return $out;
}
Пример #25
0
 /**
  * Get a settings value
  *
  * @param string $key
  *
  * @return array|bool|mixed|null|void
  */
 function get($key = '')
 {
     if (empty($this->settings)) {
         // Get the settings, attempt to fetch new settings first.
         $current_settings = get_option('siteorigin_panels_settings', false);
         if ($current_settings === false) {
             // We can't find the settings, so try access old settings
             $current_settings = get_option('siteorigin_panels_display', array());
             $post_types = get_option('siteorigin_panels_post_types');
             if (!empty($post_types)) {
                 $current_settings['post-types'] = $post_types;
             }
             // Store the old settings in the new field
             update_option('siteorigin_panels_settings', $current_settings);
         }
         // Get the settings provided by the theme
         $theme_settings = get_theme_support('siteorigin-panels');
         if (!empty($theme_settings)) {
             $theme_settings = $theme_settings[0];
         } else {
             $theme_settings = array();
         }
         $this->settings = wp_parse_args($theme_settings, apply_filters('siteorigin_panels_settings_defaults', array()));
         $this->settings = wp_parse_args($current_settings, $this->settings);
         // Filter these settings
         $this->settings = apply_filters('siteorigin_panels_settings', $this->settings);
     }
     if (!empty($key)) {
         return isset($this->settings[$key]) ? $this->settings[$key] : null;
     }
     return $this->settings;
 }
Пример #26
0
/**
 * Get sanitized background presets
 *
 * Sanitize and return presets added via add_theme_support( 'ctfw-preset-backgrounds', array() );
 *
 * @since 0.9
 * @return array Preset background images configuration
 */
function ctfw_background_image_presets()
{
    $backgrounds_clean = array();
    // Theme supports this?
    $support = get_theme_support('ctfw-preset-backgrounds');
    if (!empty($support[0])) {
        $backgrounds = apply_filters('ctfw_background_image_presets_raw', $support[0]);
        // filter before cleaning
        // Fill, clean and set defaults to prevent errors elsewhere
        foreach ($backgrounds as $file => $data) {
            if (!empty($data['thumb'])) {
                $backgrounds_clean[$file]['thumb'] = $data['thumb'];
                $backgrounds_clean[$file]['fullscreen'] = !empty($data['fullscreen']) ? true : false;
                if ($backgrounds_clean[$file]['fullscreen']) {
                    $data['repeat'] = 'no-repeat';
                    $data['attachment'] = 'fixed';
                    $data['position'] = 'left';
                }
                $backgrounds_clean[$file]['repeat'] = isset($data['repeat']) && in_array($data['repeat'], array('no-repeat', 'repeat', 'repeat-x', 'repeat-y')) ? $data['repeat'] : 'no-repeat';
                $backgrounds_clean[$file]['attachment'] = isset($data['attachment']) && in_array($data['attachment'], array('scroll', 'fixed')) ? $data['attachment'] : 'scroll';
                $backgrounds_clean[$file]['position'] = isset($data['position']) && in_array($data['position'], array('left', 'center', 'right')) ? $data['position'] : '';
                $backgrounds_clean[$file]['colorable'] = !empty($data['colorable']) ? true : false;
                // Also add absolute URL's (theme customizer uses)
                $backgrounds_clean[$file]['url'] = !empty($data['url']) ? $data['url'] : ctfw_background_image_preset_url($file);
                $backgrounds_clean[$file]['thumb_url'] = !empty($data['thumb_url']) ? $data['thumb_url'] : ctfw_background_image_preset_url($data['thumb']);
            }
        }
    }
    // Return filterable
    return apply_filters('ctfw_background_image_presets', $backgrounds_clean);
}
Пример #27
0
 /**
  * Conditionally hook into WordPress.
  *
  * Theme must declare that they support this module by adding
  * add_theme_support( 'featured-content' ); during after_setup_theme.
  *
  * If no theme support is found there is no need to hook into WordPress.
  * We'll just return early instead.
  *
  * @static
  * @access public
  */
 public static function init()
 {
     $theme_support = get_theme_support('featured-content');
     // Return early if theme does not support Featured Content.
     if (!$theme_support) {
         return;
     }
     /*
      * An array of named arguments must be passed as the second parameter
      * of add_theme_support().
      */
     if (!isset($theme_support[0])) {
         return;
     }
     // Return early if "featured_content_filter" has not been defined.
     if (!isset($theme_support[0]['featured_content_filter'])) {
         return;
     }
     $filter = $theme_support[0]['featured_content_filter'];
     // Theme can override the number of max posts.
     if (isset($theme_support[0]['max_posts'])) {
         self::$max_posts = absint($theme_support[0]['max_posts']);
     }
     add_filter($filter, array(__CLASS__, 'get_featured_posts'));
     add_action('customize_register', array(__CLASS__, 'customize_register'), 9);
     add_action('admin_init', array(__CLASS__, 'register_setting'));
     add_action('switch_theme', array(__CLASS__, 'delete_transient'));
     add_action('save_post', array(__CLASS__, 'delete_transient'));
     add_action('delete_post_tag', array(__CLASS__, 'delete_post_tag'));
     add_action('customize_controls_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
     add_action('pre_get_posts', array(__CLASS__, 'pre_get_posts'));
     add_action('wp_loaded', array(__CLASS__, 'wp_loaded'));
 }
Пример #28
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     $theme_support = get_theme_support('social-links');
     /* An array of named arguments must be passed as the second parameter
      * of add_theme_support().
      */
     if (!isset($theme_support[0]) || empty($theme_support[0])) {
         return;
     }
     $this->links = Jetpack_Options::get_option('social_links', array());
     global $publicize;
     if (is_a($publicize, 'Publicize')) {
         $this->publicize = $publicize;
         $this->services = array_intersect(array_keys($this->publicize->get_services('connected')), $theme_support[0]);
         add_action('customize_register', array($this, 'customize_register'));
         add_filter('sanitize_option_jetpack_options', array($this, 'sanitize_link'));
     }
     add_filter('jetpack_has_social_links', array($this, 'has_social_links'));
     add_filter('jetpack_get_social_links', array($this, 'get_social_links'));
     foreach ($theme_support[0] as $service) {
         add_filter("pre_option_jetpack-{$service}", array($this, 'get_social_link_filter'));
         // get_option( 'jetpack-service' );
         add_filter("theme_mod_jetpack-{$service}", array($this, 'get_social_link_filter'));
         // get_theme_mod( 'jetpack-service' );
     }
 }
Пример #29
0
/**
 * Registers the default framework dynamic sidebars based on the sidebars the theme has added support 
 * for using add_theme_support().
 *
 * @since 0.7.0
 * @access private
 * @uses register_sidebar() Registers a sidebar with WordPress.
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 * @return void
 */
function hybrid_register_sidebars()
{
    /* Get the theme-supported sidebars. */
    $supported_sidebars = get_theme_support('hybrid-core-sidebars');
    /* If the theme doesn't add support for any sidebars, return. */
    if (!is_array($supported_sidebars[0])) {
        return;
    }
    /* Get the available core framework sidebars. */
    $core_sidebars = hybrid_get_sidebars();
    /* Loop through the supported sidebars. */
    foreach ($supported_sidebars[0] as $sidebar) {
        /* Make sure the given sidebar is one of the core sidebars. */
        if (isset($core_sidebars[$sidebar])) {
            /* Set up some default sidebar arguments. */
            $defaults = array('before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-wrap widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
            /* Allow developers to filter the default sidebar arguments. */
            $defaults = apply_filters(hybrid_get_prefix() . '_sidebar_defaults', $defaults, $sidebar);
            /* Parse the sidebar arguments and defaults. */
            $args = wp_parse_args($core_sidebars[$sidebar], $defaults);
            /* If no 'id' was given, use the $sidebar variable and sanitize it. */
            $args['id'] = isset($args['id']) ? sanitize_key($args['id']) : sanitize_key($sidebar);
            /* Allow developers to filter the sidebar arguments. */
            $args = apply_filters(hybrid_get_prefix() . '_sidebar_args', $args, $sidebar);
            /* Register the sidebar. */
            register_sidebar($args);
        }
    }
}
Пример #30
0
 public static function load($old_image = '', $args = null)
 {
     $new_image = false;
     if (isset($args['fancybox']) && $args['fancybox']) {
         unset($args['fancybox']);
     }
     $args = self::process_defaults($args);
     $disable_dragonfly = pls_get_option('pls-disable-dragonfly');
     // use standard default image
     if ($old_image === '' || empty($old_image)) {
         if (!empty($args['null_image'])) {
             $old_image = $args['null_image'];
         } else {
             $old_image = PLS_IMG_URL . "/null/listing-1200x720.jpg";
         }
     } elseif ($args['allow_resize'] && $args['resize']['w'] && $args['resize']['h'] && get_theme_support('pls-dragonfly') && $disable_dragonfly != true) {
         $img_args = array('resize' => $args['resize'], 'old_image' => $old_image);
         $new_image = PLS_Plugin_API::resize_image($img_args);
     }
     if ($args['fancybox'] || $args['as_html']) {
         if ($new_image) {
             $new_image = self::as_html($old_image, $new_image, $args);
         } else {
             $new_image = self::as_html($old_image, null, $args);
         }
     }
     // return the new image if we've managed to create one
     if ($new_image) {
         return $new_image;
     } else {
         return $old_image;
     }
 }