'#74a116',
'accent_font' => '#ffffff',
'box_background' => '#ffffff',
'site_background' => '#f5f5f5',
) ) );
// Directory path for radioimage buttons
$imagepath = trailingslashit( HOOT_THEMEURI ) . 'admin/images/';
// Logo Sizes (different range than standard typography range)
$logosizes = array();
$logosizerange = range( 14, 110 );
foreach ( $logosizerange as $isr )
$logosizes[ $isr . 'px' ] = $isr . 'px';
$logosizes = apply_filters( 'hoot_theme_options_logosizes', $logosizes);
// Logo Font Options for Lite version
$logofont = apply_filters( 'hoot_theme_options_logofont', array(
'standard' => __('Standard Body Font (Open Sans)', 'brigsby'),
'heading' => __('Heading Font', 'brigsby'),
) );
/*** Add Options (Panels, Sections, Settings) ***/
/** Panel Setup & Layout **/
$panel = 'general';
$panels[ $panel ] = array(
'title' => __( 'Setup & Layout', 'brigsby' ),
'icon' => 'dashicons dashicons-admin-settings', // fa fa-sliders
);
$section = 'setup';
$sections[ $section ] = array(
'title' => __( 'Site Setup', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['site_layout'] = array(
'label' => __( 'Site Layout - Boxed vs Stretched', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'boxed' => __('Boxed layout', 'brigsby'),
'stretch' => __('Stretched layout (full width)', 'brigsby'),
),
'default' => 'stretch',
'description' => array(
'type' => 'blue',
'text' => __("For boxed layouts, both backgrounds (site and content box) can be set in the 'Styling > Backgrounds' panel.
For Stretched Layout, only site background is available.", 'brigsby'),
),
);
$settings['site_width'] = array(
'label' => __( 'Max. Site Width (pixels)', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'1260' => __('1260px (wide)', 'brigsby'),
'1080' => __('1080px (standard)', 'brigsby'),
),
'default' => '1260',
);
$settings['load_minified'] = array(
'label' => __( 'Load Minified Styles and Scripts (when available)', 'brigsby' ),
'sublabel' => __( 'Checking this option reduces data size, hence increasing page load speed.', 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
);
$section = 'logo';
$sections[ $section ] = array(
'title' => __( 'Logo Settings', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['logo_background_type'] = array(
'label' => __( 'Logo Background', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'transparent' => __('None', 'brigsby'),
'accent' => __('Accent Color', 'brigsby'),
),
'default' => 'none',
);
$settings['logo'] = array(
'label' => __( 'Site Logo', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'text' => __('Default Text (Site Title)', 'brigsby'),
'custom' => __('Custom Text', 'brigsby'),
'image' => __('Image Logo', 'brigsby'),
'mixed' => __('Image & Default Text (Site Title)', 'brigsby'),
'mixedcustom' => __('Image & Custom Text', 'brigsby'),
),
'default' => 'text',
'description' => array(
'type' => 'blue',
'text' => sprintf( __('Use %sSite Title%s as default text logo', 'brigsby'), '', '' ),
),
);
$settings['site_title_icon'] = array(
'label' => __( 'Site Title Icon (Optional)', 'brigsby' ),
'section' => $section,
'type' => 'icon',
// 'default' => 'fa-anchor',
'description' => __( 'Leave empty to hide icon.', 'brigsby' ),
'active_callback' => 'hoot_callback_site_title_icon',
);
$settings['site_title_icon_size'] = array(
'label' => __( 'Site Title Icon Size', 'brigsby' ),
'section' => $section,
'type' => 'select',
'choices' => $logosizes,
'default' => '50px',
'active_callback' => 'hoot_callback_site_title_icon_size',
);
if ( ! function_exists( 'the_custom_logo' ) )
$settings['logo_image'] = array(
'label' => __( 'Upload Logo', 'brigsby' ),
'section' => $section,
'type' => 'image',
'priority' => '75', // Replaced by WP's custom_logo if available // Update in premium if needed
'active_callback' => 'hoot_callback_logo_image',
);
$settings['logo_image_width'] = array(
'label' => __( 'Maximum Logo Width', 'brigsby' ),
'section' => $section,
'type' => 'text',
'priority' => '76', // Keep it with image logo // Update in premium if needed
'default' => 200,
'description' => __( '(in pixels)
',
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'default' => __('Default (Archives, Blog etc.)', 'brigsby'),
'posts' => __('For All Posts', 'brigsby'),
'pages' => __('For All Pages', 'brigsby'),
'no-sidebar' => __('Always override for full width pages (with no sidebar)', 'brigsby'),
),
'default' => 'default, pages, no-sidebar',
'description' => __('This is the Page Header area containing Page/Post Title and Meta details like author, categories etc.', 'brigsby'),
);
$settings['post_featured_image'] = array(
'label' => __( 'Display Featured Image', 'brigsby' ),
'sublabel' => __( 'Display featured image at the beginning of post/page content.', 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
'default' => 1,
);
$settings['post_meta'] = array(
'label' => __( 'Meta Information on Posts', 'brigsby' ),
'sublabel' => __( "Check which meta information to display on an individual 'Post' page", 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'author' => __('Author', 'brigsby'),
'date' => __('Date', 'brigsby'),
'cats' => __('Categories', 'brigsby'),
'tags' => __('Tags', 'brigsby'),
'comments' => __('No. of comments', 'brigsby')
),
'default' => 'author, date, cats, tags, comments',
);
$settings['page_meta'] = array(
'label' => __( 'Meta Information on Page', 'brigsby' ),
'sublabel' => __( "Check which meta information to display on an individual 'Page' page", 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'author' => __('Author', 'brigsby'),
'date' => __('Date', 'brigsby'),
'comments' => __('No. of comments', 'brigsby')
),
'default' => 'author, date, comments',
);
$settings['post_meta_location'] = array(
'label' => __( 'Meta Information location', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'top' => __('Top (below title)', 'brigsby'),
'bottom' => __('Bottom (after content)', 'brigsby'),
),
'default' => 'top',
);
$settings['post_prev_next_links'] = array(
'label' => __( 'Previous/Next Posts', 'brigsby' ),
'sublabel' => __( 'Display links to Prev/Next Post links at the end of post content.', 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
'default' => 1,
);
$settings['contact-form'] = array(
'label' => __( 'Contact Form', 'brigsby' ),
'section' => $section,
'type' => 'content',
'content' => sprintf( __('This theme comes bundled with CSS required to style %sContact-Form-7%s forms. Simply install and activate the plugin to add Contact Forms to your pages.', 'brigsby'), '', ''), // JNES@todo update link to docs
);
if ( current_theme_supports( 'woocommerce' ) ) :
$section = 'woocommerce';
$sections[ $section ] = array(
'title' => __( 'WooCommerce', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$wooproducts = range( 0, 99 );
for ( $wpr=0; $wpr < 4; $wpr++ )
unset( $wooproducts[$wpr] );
$settings['wooshop_products'] = array(
'label' => __( 'Total Products per page', 'brigsby' ),
'section' => $section,
'type' => 'select',
'choices' => $wooproducts,
'default' => '12',
'description' => __( 'Total number of products to show on the Shop page', 'brigsby' ),
);
$settings['wooshop_product_columns'] = array(
'label' => __( 'Product Columns', 'brigsby' ),
'section' => $section,
'type' => 'select',
'choices' => array(
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
),
'default' => '3',
'description' => __( 'Number of products to show in 1 row on the Shop page', 'brigsby' ),
);
endif;
$section = 'footer';
$sections[ $section ] = array(
'title' => __( 'Footer', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['footer'] = array(
'label' => __( 'Footer Layout', 'brigsby' ),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'1-1' => $imagepath . '1-1.png',
'2-1' => $imagepath . '2-1.png',
'2-2' => $imagepath . '2-2.png',
'2-3' => $imagepath . '2-3.png',
'3-1' => $imagepath . '3-1.png',
'3-2' => $imagepath . '3-2.png',
'3-3' => $imagepath . '3-3.png',
'3-4' => $imagepath . '3-4.png',
'4-1' => $imagepath . '4-1.png',
),
'default' => '3-1',
'description' => array(
'type' => 'red',
'text' => sprintf( __('You must first save the changes you make here and refresh this screen for footer columns to appear in the Widgets panel (in customizer).<!--default--> tag to show the default Info Text.<!--year--> tag to insert the current year.©', 'brigsby'), '', '' ),
),
);
/** Panel Styling **/
$panel = 'styling';
$panels[ $panel ] = array(
'title' => __( 'Styling', 'brigsby' ),
'icon' => 'dashicons dashicons-art', // fa fa-align-center
);
$section = 'colors';
// Redundant as 'colors' section is added by WP. But we still add it for brevity
$sections[ $section ] = array(
'title' => __( 'Colors', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['accent_color'] = array(
'label' => __( 'Accent Color', 'brigsby' ),
'section' => $section,
'type' => 'color',
'default' => $accent_color,
);
$settings['accent_font'] = array(
'label' => __( 'Font Color on Accent Color', 'brigsby' ),
'section' => $section,
'type' => 'color',
'default' => $accent_font,
);
if ( current_theme_supports( 'woocommerce' ) ) :
$settings['woocommerce-colors-plugin'] = array(
'label' => __( 'Woocommerce Styling', 'brigsby' ),
'section' => $section,
'type' => 'content',
'content' => sprintf( __('Looks like you are using Woocommerce. Install %sthis plugin%s to change colors and styles for WooCommerce elements like buttons etc.', 'brigsby'), '', '' ),
);
endif;
$section = 'backgrounds';
$sections[ $section ] = array(
'title' => __( 'Backgrounds', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['background'] = array(
'label' => __( 'Site Background', 'brigsby' ),
'section' => $section,
'type' => 'betterbackground',
'default' => array(
'color' => $site_background,
'pattern' => 'hoot/images/patterns/4.png',
),
);
$settings['box_background_color'] = array(
'label' => __( 'Content Box Background', 'brigsby' ),
'section' => $section,
'type' => 'color',
'default' => $box_background,
'description' => array(
'type' => 'blue',
'text' => __("This background is available only when 'Boxed' option is selected in the 'Setup & Layout > Site Setup' panel.", 'brigsby'),
),
// 'active_callback' => 'hoot_callback_box_background_color',
);
$section = 'typography';
$sections[ $section ] = array(
'title' => __( 'Typography', 'brigsby' ),
'panel' => $panel,
);
$settings['headings_fontface'] = array(
'label' => __( 'Headings Font', 'brigsby' ),
'section' => $section,
'type' => 'select',
'choices' => array(
'standard' => __( 'Standard Font (Open Sans)', 'brigsby'),
'heading' => __( 'Heading Font (Pacifico)', 'brigsby'),
),
'default' => 'standard',
);
/** Panel Content **/
$panel = 'content';
global $wp_version;
$panels[ $panel ] = array(
'title' => __( 'Content', 'brigsby' ),
// 'icon' => 'dashicons dashicons-editor-alignleft', // fa fa-align-center
'icon' => ( ( version_compare( $wp_version, '4.3', '>=' ) ) ? 'dashicons dashicons-editor-table' : 'dashicons dashicons-grid-view' ),
);
$section = 'topbar';
$sections[ $section ] = array(
'title' => __( 'Topbar', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['topbar-widget-areas'] = array(
'label' => __( 'Left/Right Topbar', 'brigsby' ),
'section' => $section,
'type' => 'content',
'content' => sprintf( __('You can add content to Left/Right Topbar using Text Widget in the %sWidget Management Screen%s', 'brigsby'), '', '' ),
);
$settings['topbar_hide_search'] = array(
'label' => __( 'Hide Search Box', 'brigsby' ),
'sublabel' => __( 'Check this to hide Search box in Topbar Right Column', 'brigsby' ),
'section' => $section,
'type' => 'checkbox',
);
if ( current_theme_supports( 'hoot-widgetized-template' ) ) :
// $panel = 'templates';
// global $wp_version;
// $panels[ $panel ] = array(
// 'title' => __( 'Templates', 'brigsby' ),
// 'icon' => ( ( version_compare( $wp_version, '4.3', '>=' ) ) ? 'dashicons dashicons-editor-table' : 'dashicons dashicons-grid-view' ),
// );
$section = 'widgetized-template';
$sections[ $section ] = array(
'title' => __( 'Widgetized Template - Modules', 'brigsby' ),
'panel' => $panel,
'description' => sprintf( __( "How to use this template'Widgetized Template' is a special Page Template which is often used as a quick way to create a Front Page.
Sort different sections of the 'Widgetized Template' in the order you want them to appear.
This is a sample description text for the slide.
', 'brigsby'), 'description' => array( 'type' => 'yellow', 'text' => __('You can use the<h3>Lorem Ipsum Dolor</h3> tag to create styled heading.', 'brigsby'),
),
),
'content_bg' => array(
'label' => __( 'Content Styling', 'brigsby' ),
'type' => 'select',
'default' => 'light-on-dark',
'choices' => array(
'dark' => __('Dark Font', 'brigsby'),
'light' => __('Light Font', 'brigsby'),
'dark-on-light' => __('Dark Font / Light Background', 'brigsby'),
'light-on-dark' => __('Light Font / Dark Background', 'brigsby'),
),
),
'button' => array(
'label' => __( 'Button Text', 'brigsby' ),
'type' => 'text',
),
'url' => array(
'label' => __( 'Button URL', 'brigsby' ),
'type' => 'url',
'description' => __( 'Leave empty if you do not want to show the button.', 'brigsby' ),
'input_attrs' => array(
'placeholder' => 'http://',
),
),
),
);
$settings["wt_html_slide_{$slide}-background"] = array(
'label' => sprintf( __( 'Slide %s Background', 'brigsby' ), $slide),
'section' => $section,
'type' => 'betterbackground',
'default' => array(
'color' => $accent_color,
),
'options' => array( 'color', 'image', 'pattern' ),
);
} // end for
$section = 'slider_img';
$sections[ $section ] = array(
'title' => __( 'Widgetized Template - Image Slider', 'brigsby' ),
'panel' => $panel,
);
$settings['wt_img_slider_width'] = array(
'label' => __( 'Slider Width', 'brigsby' ),
'sublabel' => __("Note: This option is useful only if the Site Layout option is set to Stretched in 'Setup & Layout > Site Setup' panel.", 'brigsby'),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'boxed' => $imagepath . 'slider-width-boxed.png',
'stretch' => $imagepath . 'slider-width-stretch.png',
),
'default' => 'boxed',
);
$settings['wt_img_slider'] = array(
'label' => __( 'Slides', 'brigsby' ),
'section' => $section,
'type' => 'content',
);
for ( $slide = 1; $slide <= 4; $slide++ ) {
$settings["wt_img_slide_{$slide}"] = array(
'label' => '',//sprintf( __( 'Slide %s Content', 'brigsby' ), $slide),
'section' => $section,
'type' => 'group',
'button' => sprintf( __( 'Edit Slide %s', 'brigsby' ), $slide),
'options' => array(
'description' => array(
'label' => '',
'type' => 'content',
'content' => '' . sprintf( __( 'Slide %s Content', 'brigsby' ), $slide) . '' . __( 'To hide this slide, simply leave the Image empty.', 'brigsby' ),
),
'image' => array(
'label' => __( 'Slide Image', 'brigsby' ),
'type' => 'image',
'description' => __( 'The main showcase image.', 'brigsby' ),
),
'caption' => array(
'label' => __( 'Slide Caption (optional)', 'brigsby' ),
'type' => 'textarea',
),
'caption_bg' => array(
'label' => __( 'Caption Styling', 'brigsby' ),
'type' => 'select',
'default' => 'dark-on-light',
'choices' => array(
'dark' => __('Dark Font', 'brigsby'),
'light' => __('Light Font', 'brigsby'),
'dark-on-light' => __('Dark Font / Light Background', 'brigsby'),
'light-on-dark' => __('Light Font / Dark Background', 'brigsby'),
),
),
'url' => array(
'label' => __( 'Slide Link', 'brigsby' ),
'type' => 'url',
'description' => __( 'Leave empty if you do not want to link the slide.', 'brigsby' ),
'input_attrs' => array(
'placeholder' => 'http://',
),
),
'button' => array(
'label' => __( 'Slide Button Text', 'brigsby' ),
'type' => 'text',
'description' => __( 'Leave empty if you do not want to show the button and instead link the slide image (if you have a url set in the above field)', 'brigsby' ),
),
),
);
} // end for
endif;
/*** Return Options Array ***/
return apply_filters( 'hoot_theme_customizer_options', array(
'settings' => $settings,
'sections' => $sections,
'panels' => $panels,
) );
}
endif;
/**
* Add Options (settings, sections and panels) to Hoot_Customizer class options object
*
* @since 1.0
* @access public
* @return void
*/
if ( !function_exists( 'hoot_theme_add_customizer_options' ) ) :
function hoot_theme_add_customizer_options() {
$hoot_customizer = Hoot_Customizer::get_instance();
// Add Options
$options = hoot_theme_customizer_options();
$hoot_customizer->add_options( array(
'settings' => $options['settings'],
'sections' => $options['sections'],
'panels' => $options['panels'],
) );
// Add Inforbuttons
$hoot_customizer->add_infobuttons( array(
'docs' => array( 'text' => __( 'Documentation & Support', 'brigsby'),
'url' => 'http://help.wphoot.com/support/solutions',
'icon' => 'fa fa-support' ),
'rate' => array( 'text' => __( 'If you like this theme, support our work by giving it a 5 rating on wordpress.org :)', 'brigsby'),
'url' => 'https://wordpress.org/support/view/theme-reviews/brigsby#postform',
'icon' => 'fa fa-star' ),
) );
}
endif;
add_action( 'init', 'hoot_theme_add_customizer_options', 0 ); // cannot hook into 'after_setup_theme' as this hook is already being executed (this file is loaded at after_setup_theme @priority 10) (hooking into same hook from within while hook is being executed leads to undesirable effects as $GLOBALS[$wp_filter]['after_setup_theme'] has already been ksorted)
// Hence, we hook into 'init' @priority 0, so that settings array gets populated before 'widgets_init' action ( which itself is hooked to 'init' at priority 1 ) for creating widget areas ( settings array is needed for creating defaults when user value has not been stored )
/**
* Add Icons for WordPress Default Panels to Icon Nav
*
* @since 1.0
* @param array $panels
* @return array
*/
function hoot_customizer_panel_icons( $panels ) {
$panels['widgets'] = array(
'title' => __( 'Widgets & Sidebars', 'brigsby' ),
'icon' => 'dashicons dashicons-admin-plugins', // fa fa-puzzle-piece
);
global $wp_version;
if ( version_compare( $wp_version, '4.3', '>=' ) ) {
$panels['nav_menus'] = array(
'title' => __( 'Menus', 'brigsby' ),
'icon' => 'dashicons dashicons-menu', // fa fa-bars
);
}
return $panels;
}
add_filter( 'hoot_customizer_panel_icons', 'hoot_customizer_panel_icons' );
/**
* Add Content to JS object passed to hoot-customizer-script
*
* @since 1.0
* @param array $data
* @return array
*/
function hoot_theme_customizer_premium_fly_js_object( $data ) {
$data['premium-section-reorder'] ='true';
return $data;
}
add_filter( 'hoot_customizer_control_footer_js_data_objec', 'hoot_theme_customizer_premium_fly_js_object' );
/**
* Enqueue custom scripts to customizer screen
*
* @since 1.0
* @return void
*/
function hoot_theme_customizer_enqueue_scripts() {
// Enqueue Styles
wp_enqueue_style( 'hoot-theme-customizer-styles', trailingslashit( HOOT_THEMEURI ) . 'admin/css/customizer.css', array(), HOOT_VERSION );
// Enqueue Scripts
wp_enqueue_script( 'hoot-theme-customizer-script', trailingslashit( HOOT_THEMEURI ) . 'admin/js/customizer.js', array( 'jquery', 'wp-color-picker', 'customize-controls', 'hoot-customizer-script' ), HOOT_VERSION, true );
}
// Load scripts at priority 11 so that Hoot Customizer Custom Controls have loaded their scripts
add_action( 'customize_controls_enqueue_scripts', 'hoot_theme_customizer_enqueue_scripts', 12 );
/**
* Modify default WordPress Settings Sections and Panels
*
* @since 1.0
* @param object $wp_customize
* @return void
*/
function hoot_customizer_modify_default_options( $wp_customize ) {
if ( function_exists( 'the_custom_logo' ) ) {
$wp_customize->get_control( 'custom_logo' )->section = 'logo';
$wp_customize->get_control( 'custom_logo' )->priority = 75; // Replaces theme's logo_image // Update in premium if needed
$wp_customize->get_control( 'custom_logo' )->width = 255;
$wp_customize->get_control( 'custom_logo' )->height = 95;
// $wp_customize->get_control( 'custom_logo' )->type = 'image'; // Stored value becomes url instead of image ID (fns like the_custom_logo() dont work)
// Defaults: [type] => cropped_image, [width] => 150, [height] => 150, [flex_width] => 1, [flex_height] => 1, [button_labels] => array(...), [label] => Logo
$wp_customize->get_control( 'custom_logo' )->active_callback = 'hoot_callback_logo_image';
}
$wp_customize->get_section( 'title_tagline' )->panel = 'general';
$wp_customize->get_section( 'title_tagline' )->priority = 1;
$wp_customize->get_section( 'static_front_page' )->panel = 'content';
$wp_customize->get_section( 'static_front_page' )->priority = 1;
$wp_customize->get_section( 'colors' )->panel = 'styling';
// global $wp_version;
// if ( version_compare( $wp_version, '4.3', '>=' ) ) // 'Creating Default Object from Empty Value' error before 4.3 since 'nav_menus' panel did not exist ( we did have 'nav' section till 4.1.9 i.e. before 4.2 )
// $wp_customize->get_panel( 'nav_menus' )->priority = 999;
// This will set the priority, however will give a 'Creating Default Object from Empty Value' error first.
// $wp_customize->get_panel( 'widgets' )->priority = 999;
}
add_action( 'customize_register', 'hoot_customizer_modify_default_options', 100 );
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @since 1.0
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @return void
*/
function hoot_customizer_customize_register( $wp_customize ) {
// $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
}
add_action( 'customize_register', 'hoot_customizer_customize_register' );
/**
* Callback Functions for customizer settings
*/
function hoot_callback_site_title_icon( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' || $selector == 'custom' ) ? true : false;
}
function hoot_callback_site_title_icon_size( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' || $selector == 'custom' ) ? true : false;
}
function hoot_callback_logo_image( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'image' || $selector == 'mixed' || $selector == 'mixedcustom' ) ? true : false;
}
function hoot_callback_logo_image_width( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'mixed' || $selector == 'mixedcustom' ) ? true : false;
}
function hoot_callback_logo_custom( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'custom' || $selector == 'mixedcustom' ) ? true : false;
}
function hoot_callback_show_tagline( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' || $selector == 'custom' || $selector == 'mixed' || $selector == 'mixedcustom' ) ? true : false;
}
function hoot_callback_box_background_color( $control ) {
$selector = $control->manager->get_setting('site_layout')->value();
return ( $selector == 'boxed' ) ? true : false;
}
/**
* Specific Sanitization Functions for customizer settings
* This is disabled by default. Users need to add filter to enable this.
* See specific settings above for more details.
*/
function hoot_custom_sanitize_textarea_allowscript( $value ) {
global $allowedposttags;
// Allow javascript to let users ad code for ads etc.
$allow = array_merge( $allowedposttags, array(
'script' => array( 'type' => true, ),
) );
return wp_kses( $value , $allow );
}