'#40c2a6',
'accent_font' => '#ffffff',
'box_background' => '#ffffff',
'site_background' => '#ffffff',
// 'font_size' => '14px',
// 'font_face' => '"Lato", sans-serif',
// 'font_style' => 'none',
// 'font_color' => '#444444',
) ) );
// 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);
/*** Add Options (Panels, Sections, Settings) ***/
/** Section **/
$section = 'links';
$sections[ $section ] = array(
'title' => __( 'Demo / Support', 'chromatic' ),
'priority' => '2',
);
$lcontent = '';
$lcontent .= '' .
' ' .
__( "Demo", 'chromatic') .
'' .
__( "Demo the theme features and options with sample content.", 'chromatic') .
'';
$ocdilink = ( class_exists( 'Hoot_Premium_Theme' ) ) ? ( ( class_exists( 'OCDI_Plugin' ) ) ? admin_url( 'themes.php?page=pt-one-click-demo-import' ) : 'https://wphoot.com/support/chromatic/#docs-section-demo-content' ) : 'https://wphoot.com/support/chromatic/#docs-section-demo-content-free';
$lcontent .= '' .
' ' .
esc_html__( "1 Click Installation", 'chromatic') .
'' .
esc_html__( "Install demo content to make your site look exactly like the Demo Site. Use it as a starting point instead of starting from scratch.", 'chromatic') .
'';
$lcontent .= '' .
' ' .
__( "Documentation / Support", 'chromatic') .
'' .
__( "Get theme related support for both free and premium users.", 'chromatic') .
'';
$lcontent .= '' .
'5 ' .
__( "Rate Us", 'chromatic') .
'' .
__( "If you are happy with the theme, give us a 5 star rating on wordpress.org", 'chromatic') .
'';
$settings['linksection'] = array(
// 'label' => __( 'Misc Links', 'chromatic' ),
'section' => $section,
'type' => 'content',
'priority' => '8', // Non static options must have a priority
'content' => $lcontent,
);
/** Section **/
$section = 'title_tagline';
$sections[ $section ] = array(
'title' => __( 'Setup & Layout', 'chromatic' ),
);
$settings['site_layout'] = array(
'label' => __( 'Site Layout - Boxed vs Stretched', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'boxed' => __('Boxed layout', 'chromatic'),
'stretch' => __('Stretched layout (full width)', 'chromatic'),
),
'default' => 'stretch',
'description' => __("For boxed layouts, both backgrounds (site and content box) can be set in the 'Backgrounds' section.
For Stretched Layout, only site background is available.", 'chromatic'),
);
$settings['site_width'] = array(
'label' => __( 'Max. Site Width (pixels)', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'1260' => __('1260px (wide)', 'chromatic'),
'1080' => __('1080px (standard)', 'chromatic'),
),
'default' => '1260',
);
$settings['mobile_menu'] = array(
'label' => __( 'Mobile Menu', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'inline' => __('Inline - Menu Slide Downs to open', 'chromatic'),
'fixed' => __('Fixed - Menu opens on the left', 'chromatic'),
),
'default' => 'fixed',
'priority' => '25', // @todo remove
);
$settings['mobile_submenu_click'] = array(
'label' => __( "[Mobile Menu] Submenu opens on 'Click'", 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'default' => 1,
'priority' => '25', // @todo remove
'description' => __( "Uncheck this option to make all Submenus appear in 'Open' state. By default, submenus open on clicking (i.e. single tap on mobile).", 'chromatic' ),
);
$settings['load_minified'] = array(
'label' => __( 'Load Minified Styles and Scripts (when available)', 'chromatic' ),
'sublabel' => __( 'Checking this option reduces data size, hence increasing page load speed.', 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
// 'default' => 1,
);
$settings['sidebar_desc'] = array(
'label' => __( 'Multiple Sidebars', 'chromatic' ),
'section' => $section,
'type' => 'content',
'content' => sprintf( __( 'This theme can display different sidebar content on different pages of your site with the %1sCustom Sidebars%2s plugin. Simply install and activate the plugin to use it with this theme. Or if you are using %3sJetpack%4s, you can use the %5s"Widget Visibility"%6s module.', 'chromatic' ), '', '', '', '', '', '' ),
);
$settings['sidebar'] = array(
'label' => __( 'Sidebar Layout (Site-wide)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for your entire site.", 'chromatic'),
);
$settings['sidebar_archives'] = array(
'label' => __( 'Sidebar Layout (for Blog/Archives)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for blog and archives pages like categories, tags etc.", 'chromatic'),
);
$settings['sidebar_pages'] = array(
'label' => __( 'Sidebar Layout (for Pages)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for pages.", 'chromatic'),
);
$settings['sidebar_posts'] = array(
'label' => __( 'Sidebar Layout (for single Posts)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for single posts.", 'chromatic'),
);
if ( current_theme_supports( 'woocommerce' ) ) :
$settings['sidebar_wooshop'] = array(
'label' => __( 'Sidebar Layout (Woocommerce Shop/Archives)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'priority' => '83', // Non static options must have a priority
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for WooCommerce shop and archives pages like product categories etc.", 'chromatic'),
);
$settings['sidebar_wooproduct'] = array(
'label' => __( 'Sidebar Layout (Woocommerce Single Product Page)', 'chromatic' ),
'section' => $section,
'type' => 'radioimage',
'priority' => '83', // Non static options must have a priority
'choices' => array(
'wide-right' => $imagepath . 'sidebar-wide-right.png',
'narrow-right' => $imagepath . 'sidebar-narrow-right.png',
'wide-left' => $imagepath . 'sidebar-wide-left.png',
'narrow-left' => $imagepath . 'sidebar-narrow-left.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for WooCommerce product pages", 'chromatic'),
);
endif;
/** Section **/
$section = 'logo';
$sections[ $section ] = array(
'title' => __( 'Logo', 'chromatic' ),
);
$settings['logo'] = array(
'label' => __( 'Site Logo', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'text' => __('Default Text (Site Title)', 'chromatic'),
'image' => __('Image Logo', 'chromatic'),
'mixed' => __('Image & Default Text (Site Title)', 'chromatic'),
),
'default' => 'text',
'description' => sprintf( __('Use %sSite Title%s as default text logo', 'chromatic'), '', '' ),
);
$settings['logo_size'] = array(
'label' => __( 'Logo Size', 'chromatic' ),
'section' => $section,
'type' => 'select',
'priority' => '95', // Non static options must have a priority
'choices' => array(
'tiny' => __( 'Tiny', 'chromatic'),
'small' => __( 'Small', 'chromatic'),
'medium' => __( 'Medium', 'chromatic'),
'large' => __( 'Large', 'chromatic'),
'huge' => __( 'Huge', 'chromatic'),
),
'default' => 'medium',
'active_callback' => 'hoot_callback_logo_size',
); // Removed in premium
$settings['site_title_icon'] = array(
'label' => __( 'Site Title Icon (Optional)', 'chromatic' ),
'section' => $section,
'type' => 'icon',
// 'default' => 'fa-anchor fas',
'description' => __( 'Leave empty to hide icon.', 'chromatic' ),
'active_callback' => 'hoot_callback_site_title_icon',
);
$settings['site_title_icon_size'] = array(
'label' => __( 'Site Title Icon Size', 'chromatic' ),
'section' => $section,
'type' => 'select',
'choices' => $logosizes,
'default' => '45px',
'active_callback' => 'hoot_callback_site_title_icon',
);
$settings['logo_image_width'] = array(
'label' => __( 'Maximum Logo Width', 'chromatic' ),
'section' => $section,
'type' => 'text',
'priority' => '116', // Keep it with logo image ( 'custom_logo' )->priority logo
'default' => 200,
'description' => __( '(in pixels)
'Widgetized Template' is a special Page Template which is often used as a quick way to create a Front Page.
This is a sample description text for the slide.
', 'chromatic'), 'description' => __('You can use the<h3>Lorem Ipsum Dolor</h3>
tag to create styled heading.', 'chromatic'),
),
'button' => array(
'label' => __( 'Button Text', 'chromatic' ),
'type' => 'text',
),
'url' => array(
'label' => __( 'Button URL', 'chromatic' ),
'type' => 'url',
'description' => __( 'Leave empty if you do not want to show the button.', 'chromatic' ),
'input_attrs' => array(
'placeholder' => 'http://',
),
),
),
);
$settings["wt_html_slide_{$slide}-background"] = array(
'label' => sprintf( __( 'Slide %s Background', 'chromatic' ), $slide),
'section' => $section,
'type' => 'betterbackground',
'priority' => 165, // Non static options must have a priority
'default' => array(
'color' => '#ffffff',
),
'options' => array( 'color', 'image', 'pattern' ),
);
} // end for
/** Section **/
$section = 'slider_img';
$sections[ $section ] = array(
'title' => __( 'Widgetized Template - Image Slider', 'chromatic' ),
// 'description' => __( 'The premium version comes with a separate Slider type allowing creation of Unlimited slides.', 'chromatic' ),
);
$settings['wt_img_slider_width'] = array(
'label' => __( 'Slider Width', 'chromatic' ),
'sublabel' => __("Note: This option is useful only if the Site Layout option is set to Stretched in 'Setup & Layout' section.", 'chromatic'),
'section' => $section,
'type' => 'radioimage',
'choices' => array(
'boxed' => $imagepath . 'slider-width-boxed.png',
'stretch' => $imagepath . 'slider-width-stretch.png',
),
'default' => 'boxed',
);
for ( $slide = 1; $slide <= 4; $slide++ ) {
$settings["wt_img_slide_{$slide}"] = array(
'label' => '',//sprintf( __( 'Slide %s Content', 'chromatic' ), $slide),
'section' => $section,
'type' => 'group',
'priority' => 175, // Non static options must have a priority
'button' => sprintf( __( 'Edit Slide %s', 'chromatic' ), $slide),
'options' => array(
'description' => array(
'label' => '',
'type' => 'content',
'content' => '' . sprintf( __( 'Slide %s Content', 'chromatic' ), $slide) . '' . __( 'To hide this slide, simply leave the Image empty.', 'chromatic' ),
),
'image' => array(
'label' => __( 'Slide Image', 'chromatic' ),
'type' => 'image',
'description' => __( 'The main showcase image.', 'chromatic' ),
),
'caption' => array(
'label' => __( 'Slide Caption (optional)', 'chromatic' ),
'type' => 'text',
),
'url' => array(
'label' => __( 'Slide Link', 'chromatic' ),
'type' => 'url',
'description' => __( 'Leave empty if you do not want to link the slide.', 'chromatic' ),
'input_attrs' => array(
'placeholder' => 'http://',
),
),
'button' => array(
'label' => __( 'Slide Button Text', 'chromatic' ),
'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)', 'chromatic' ),
),
),
);
} // end for
endif;
/** Section **/
$section = 'archives';
$sections[ $section ] = array(
'title' => __( 'Archives (Blog, Cats, Tags)', 'chromatic' ),
);
$settings['archive_post_content'] = array(
'label' => __( 'Post Items Content', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'none' => __('None', 'chromatic'),
'excerpt' => __('Post Excerpt', 'chromatic'),
'full-content' => __('Full Post Content', 'chromatic'),
),
'default' => 'excerpt',
'description' => __( 'Content to display for each post in the list', 'chromatic' ),
);
$settings['archive_post_meta'] = array(
'label' => __( 'Meta Information for Post List Items', 'chromatic' ),
'sublabel' => __( 'Check which meta information to display for each post item in the archive list.', 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'author' => __('Author', 'chromatic'),
'date' => __('Date', 'chromatic'),
'cats' => __('Categories', 'chromatic'),
'tags' => __('Tags', 'chromatic'),
'comments' => __('No. of comments', 'chromatic')
),
'default' => 'author, date, cats, comments',
);
$settings['excerpt_length'] = array(
'label' => __( 'Excerpt Length', 'chromatic' ),
'section' => $section,
'type' => 'text',
'description' => __( 'Number of words in excerpt. Default is 105. Leave empty if you dont want to change it.', 'chromatic' ),
'input_attrs' => array(
'placeholder' => __( 'default: 105', 'chromatic' ),
),
);
$settings['read_more'] = array(
'label' => __( "'Read More' Text", 'chromatic' ),
'section' => $section,
'type' => 'text',
'description' => __( "Replace the default 'Read More' text. Leave empty if you dont want to change it.", 'chromatic' ),
'input_attrs' => array(
'placeholder' => __( 'default: READ MORE →', 'chromatic' ),
),
);
/** Section **/
$section = 'singular';
$sections[ $section ] = array(
'title' => __( 'Single (Posts, Pages)', 'chromatic' ),
);
$settings['post_featured_image'] = array(
'label' => __( 'Display Featured Image', 'chromatic' ),
'sublabel' => __( 'Display featured image at the beginning of post/page content.', 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'default' => 1,
);
$settings['post_meta'] = array(
'label' => __( 'Meta Information on Posts', 'chromatic' ),
'sublabel' => __( "Check which meta information to display on an individual 'Post' page", 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'author' => __('Author', 'chromatic'),
'date' => __('Date', 'chromatic'),
'cats' => __('Categories', 'chromatic'),
'tags' => __('Tags', 'chromatic'),
'comments' => __('No. of comments', 'chromatic')
),
'default' => 'author, date, cats, tags, comments',
);
$settings['page_meta'] = array(
'label' => __( 'Meta Information on Page', 'chromatic' ),
'sublabel' => __( "Check which meta information to display on an individual 'Page' page", 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'choices' => array(
'author' => __('Author', 'chromatic'),
'date' => __('Date', 'chromatic'),
'comments' => __('No. of comments', 'chromatic')
),
'default' => 'author, date, comments',
);
$settings['post_meta_location'] = array(
'label' => __( 'Meta Information location', 'chromatic' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'top' => __('Top (below title)', 'chromatic'),
'bottom' => __('Bottom (after content)', 'chromatic'),
),
'default' => 'top',
);
$settings['post_prev_next_links'] = array(
'label' => __( 'Previous/Next Posts', 'chromatic' ),
'sublabel' => __( 'Display links to Prev/Next Post links at the end of post content.', 'chromatic' ),
'section' => $section,
'type' => 'checkbox',
'default' => 1,
);
$settings['contact-form'] = array(
'label' => __( 'Contact Form', 'chromatic' ),
'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.', 'chromatic'), '', ''), // @todo update link to docs
);
/** Section **/
$section = 'footer';
$sections[ $section ] = array(
'title' => __( 'Footer', 'chromatic' ),
);
$settings['footer'] = array(
'label' => __( 'Footer Layout', 'chromatic' ),
'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' => '4-1',
'description' => 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.©
', 'chromatic'), '', '' ),
);
/*** 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 3.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(
// 'demo' => array( 'text' => __( 'Demo', 'chromatic'),
// 'url' => 'https://demo.wphoot.com/chromatic/',
// 'icon' => 'fas fa-eye' ),
// 'docs' => array( 'text' => __( 'Docs / Support', 'chromatic'),
// 'url' => 'https://wphoot.com/support/',
// 'icon' => 'far fa-life-ring' ),
// 'rate' => array( 'text' => __( 'Rating', 'chromatic'),
// 'url' => 'https://wordpress.org/support/theme/chromatic/reviews/#new-post',
// 'icon' => 'fas fa-star' ),
// ) );
// Add Premium Infobutton
// $hoot_customizer->add_infobuttons( array(
// 'premium' => array( 'text' => __( 'Premium', 'chromatic'),
// 'type' => 'premium',
// 'url' => esc_url( admin_url('themes.php?page=chromatic-welcome') ),
// 'icon' => 'fa-rocket fas' ),
// ) );
}
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 )
/**
* Enqueue custom scripts to customizer screen
*
* @since 4.1
* @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/customize-controls.js', array( 'jquery', 'wp-color-picker', 'customize-controls', 'hoot-customizer-script' ), HOOT_VERSION, true );
}
// Load scripts at priority 12 so that Hoot Customizer Interface (11) / Custom Controls (10) have loaded their scripts
add_action( 'customize_controls_enqueue_scripts', 'hoot_theme_customizer_enqueue_scripts', 12 );
/**
* Modify default WordPress Settings Sections and Panels
*
* @since 3.0
* @param object $wp_customize
* @return void
*/
function hoot_customizer_modify_default_options( $wp_customize ) {
$wp_customize->get_control( 'custom_logo' )->section = 'logo';
$wp_customize->get_control( 'custom_logo' )->priority = 115;
$wp_customize->get_control( 'custom_logo' )->width = 280;
$wp_customize->get_control( 'custom_logo' )->height = 65;
// $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';
if ( function_exists( 'get_site_icon_url' ) )
$wp_customize->get_control( 'site_icon' )->priority = 10;
$wp_customize->get_section( 'static_front_page' )->priority = 3;
// $wp_customize->get_section( 'title_tagline' )->panel = 'general';
// $wp_customize->get_section( 'title_tagline' )->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 3.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_logo_size( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' || $selector == 'mixed' ) ? true : false;
}
function hoot_callback_site_title_icon( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' ) ? true : false;
}
function hoot_callback_logo_image( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'image' || $selector == 'mixed' ) ? true : false;
}
function hoot_callback_logo_image_width( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'mixed' ) ? true : false;
}
function hoot_callback_show_tagline( $control ) {
$selector = $control->manager->get_setting('logo')->value();
return ( $selector == 'text' || $selector == 'mixed' ) ? 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
* 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( 'async' => true, 'charset' => true, 'defer' => true, 'src' => true, 'type' => true ),
) );
return wp_kses( $value , $allow );
}