'#74a116',
'accent_font' => '#ffffff',
'box_background' => '#ffffff',
'site_background' => '#f5f5f5',
'site_background_patt' => 'hoot/images/patterns/4.png',
) ) );
// 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', 'brigsby'),
'heading' => __('Logo Font (Styling > Typography)', '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 > Colors' 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',
'priority' => '25', // Non static options must have a priority
);
$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',
'priority' => '25', // Non static options must have a priority
'choices' => array(
'transparent' => __('None', 'brigsby'),
'accent' => __('Accent Color', 'brigsby'),
),
'default' => 'transparent',
);
$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['logo_size'] = array(
'label' => __( 'Logo Size', 'brigsby' ),
'section' => $section,
'type' => 'select',
'priority' => '35', // Non static options must have a priority
'choices' => array(
'tiny' => __( 'Tiny', 'brigsby'),
'small' => __( 'Small', 'brigsby'),
'medium' => __( 'Medium', 'brigsby'),
'large' => __( 'Large', 'brigsby'),
'huge' => __( 'Huge', 'brigsby'),
),
'default' => 'medium',
'active_callback' => 'hoot_callback_logo_size',
);
$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',
);
if ( ! function_exists( 'the_custom_logo' ) )
$settings['logo_image'] = array(
'label' => __( 'Upload Logo', 'brigsby' ),
'section' => $section,
'type' => 'image',
'priority' => '55', // 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' => '56', // Keep it with image logo // Update in premium if needed
'default' => 200,
'description' => __( '(in pixels)
',
);
$settings['primary_menuarea'] = array(
'label' => __( 'Primary Area (right of logo)', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'menu' => __('Display Primary Menu', 'brigsby'),
'search' => __('Display Search', 'brigsby'),
'custom' => __('Custom Text', 'brigsby'),
'none' => __('None (Logo will get centre aligned)', 'brigsby'),
),
'default' => 'menu',
);
$settings['primary_menuarea_custom'] = array(
'label' => __( 'Custom Text instead of Menu', 'brigsby' ),
'section' => $section,
'type' => 'textarea',
'active_callback' => 'hoot_callback_show_primary_menuarea_custom',
);
// Allow users to add javascript in case they need to use this area to insert code for ads
// etc. To enable this, add the following code in your child theme's functions.php file (without
// the '//').
// add_filter( 'primary_menuarea_custom_allowscript', 'hoot_child_textarea_allowscript' );
// function hoot_child_textarea_allowscript(){ return true; }
if ( apply_filters( 'primary_menuarea_custom_allowscript', true ) )
$settings['primary_menuarea_custom']['sanitize_callback'] = 'hoot_custom_sanitize_textarea_allowscript';
$settings['secondary_menu_location'] = array(
'label' => __( 'Secondary Menu Location', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'top' => __('Top (above logo)', 'brigsby'),
'bottom' => __('Bottom (below logo)', 'brigsby'),
'none' => __('Do not display secondary menu', 'brigsby'),
),
'default' => 'bottom',
);
$settings['secondary_menu_align'] = array(
'label' => __( 'Secondary Menu Alignment', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'left' => __('Left', 'brigsby'),
'right' => __('Right', 'brigsby'),
'center' => __('Center', 'brigsby'),
),
'default' => 'center',
);
$section = 'sidebar_layout';
$sections[ $section ] = array(
'title' => __( 'Sidebar Layout', 'brigsby' ),
'panel' => $panel,
'description' => sprintf( __( 'If you are using %1sJetpack%2s, use the %3s"Widget Visibility"%4s module to display different sidebar content on different pages of your site.', 'brigsby' ), '', '', '', '' ),
);
$settings['sidebar'] = array(
'label' => __( 'Sidebar Layout (Site-wide)', 'brigsby' ),
'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',
'narrow-left-right' => $imagepath . 'sidebar-narrow-left-right.png',
'narrow-left-left' => $imagepath . 'sidebar-narrow-left-left.png',
'narrow-right-right' => $imagepath . 'sidebar-narrow-right-right.png',
'full-width' => $imagepath . 'sidebar-full.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for your site.", 'brigsby'),
);
$settings['sidebar_pages'] = array(
'label' => __( 'Sidebar Layout (for Pages)', 'brigsby' ),
'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',
'narrow-left-right' => $imagepath . 'sidebar-narrow-left-right.png',
'narrow-left-left' => $imagepath . 'sidebar-narrow-left-left.png',
'narrow-right-right' => $imagepath . 'sidebar-narrow-right-right.png',
'full-width' => $imagepath . 'sidebar-full.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
);
$settings['sidebar_posts'] = array(
'label' => __( 'Sidebar Layout (for single Posts)', 'brigsby' ),
'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',
'narrow-left-right' => $imagepath . 'sidebar-narrow-left-right.png',
'narrow-left-left' => $imagepath . 'sidebar-narrow-left-left.png',
'narrow-right-right' => $imagepath . 'sidebar-narrow-right-right.png',
'full-width' => $imagepath . 'sidebar-full.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
);
if ( current_theme_supports( 'woocommerce' ) ) :
$settings['sidebar_wooshop'] = array(
'label' => __( 'Sidebar Layout (Woocommerce Shop/Archives)', 'brigsby' ),
'section' => $section,
'type' => 'radioimage',
'priority' => '155', // 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',
'narrow-left-right' => $imagepath . 'sidebar-narrow-left-right.png',
'narrow-left-left' => $imagepath . 'sidebar-narrow-left-left.png',
'narrow-right-right' => $imagepath . 'sidebar-narrow-right-right.png',
'full-width' => $imagepath . 'sidebar-full.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.", 'brigsby'),
);
$settings['sidebar_wooproduct'] = array(
'label' => __( 'Sidebar Layout (Woocommerce Single Product Page)', 'brigsby' ),
'section' => $section,
'type' => 'radioimage',
'priority' => '155', // 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',
'narrow-left-right' => $imagepath . 'sidebar-narrow-left-right.png',
'narrow-left-left' => $imagepath . 'sidebar-narrow-left-left.png',
'narrow-right-right' => $imagepath . 'sidebar-narrow-right-right.png',
'full-width' => $imagepath . 'sidebar-full.png',
'none' => $imagepath . 'sidebar-none.png',
),
'default' => 'wide-right',
'description' => __("Set the default sidebar width and position for WooCommerce product page", 'brigsby'),
);
endif;
$section = 'archives';
$sections[ $section ] = array(
'title' => __( 'Archives (Blog, Cats, Tags)', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['archive_post_content'] = array(
'label' => __( 'Post Items Content', 'brigsby' ),
'section' => $section,
'type' => 'radio',
'choices' => array(
'excerpt' => __('Post Excerpt', 'brigsby'),
'full-content' => __('Full Post Content', 'brigsby'),
),
'default' => 'excerpt',
'description' => __( 'Content to display for each post in the list', 'brigsby' ),
);
$settings['archive_post_meta'] = array(
'label' => __( 'Meta Information for Post List Items', 'brigsby' ),
'sublabel' => __( 'Check which meta information to display for each post item in the archive list.', '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, comments',
);
$settings['excerpt_length'] = array(
'label' => __( 'Excerpt Length', 'brigsby' ),
'section' => $section,
'type' => 'text',
'description' => __( 'Number of words in excerpt. Default is 105. Leave empty if you dont want to change it.', 'brigsby' ),
'input_attrs' => array(
'min' => 0,
'max' => 3,
'placeholder' => __( 'default: 105', 'brigsby' ),
),
);
$settings['read_more'] = array(
'label' => __( "'Read More' Text", 'brigsby' ),
'section' => $section,
'type' => 'text',
'description' => __( "Replace the default 'Read More' text. Leave empty if you dont want to change it.", 'brigsby' ),
'input_attrs' => array(
'placeholder' => __( 'default: READ MORE →', 'brigsby' ),
),
);
$section = 'singular';
$sections[ $section ] = array(
'title' => __( 'Single (Posts, Pages)', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
);
$settings['page_header_full'] = array(
'label' => __( 'Stretch Page Header to Full Width', 'brigsby' ),
'sublabel' => '
',
'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 (any page which has no sidebar)', 'brigsby'),
),
'default' => 'default, pages',
'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,
);
if ( current_theme_supports( 'woocommerce' ) ) :
$section = 'woocommerce';
$sections[ $section ] = array(
'title' => __( 'WooCommerce', 'brigsby' ),
'panel' => $panel,
// 'description' => __( '', 'brigsby' ),
'priority' => '225', // Non static options must have a priority
);
$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',
'priority' => '255', // Non static options must have a priority
'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',
'priority' => '255', // Non static options must have a priority
'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';
$sections[ $section ] = array(
'title' => __( 'Colors', 'brigsby' ),
'panel' => $panel,
);
$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'),
),
);
$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,
);
$section = 'typography';
$sections[ $section ] = array(
'title' => __( 'Typography', 'brigsby' ),
'panel' => $panel,
'priority' => '245', // Non static options must have a priority
);
$settings['logo_fontface'] = array(
'label' => __( 'Logo Font (Free Version)', 'brigsby' ),
'section' => $section,
'type' => 'select',
'priority' => 305, // Non static options must have a priority
'choices' => array(
'standard' => __( 'Standard Font (Open Sans)', 'brigsby'),
'cursive' => __( 'Cursive Font (Pacifico)', 'brigsby'),
),
'default' => 'cursive',
);
/** 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' ) ) :
$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',
'priority' => 705, // Non static options must have a priority
'default' => array(
'color' => '#dddddd',
),
'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',
);
for ( $slide = 1; $slide <= 4; $slide++ ) {
$settings["wt_img_slide_{$slide}"] = array(
'label' => '',//sprintf( __( 'Slide %s Content', 'brigsby' ), $slide),
'section' => $section,
'type' => 'group',
'priority' => 715, // Non static options must have a priority
'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',
'default' => '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'),
),
),
'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(
'demo' => array( 'text' => __( 'Demo', 'brigsby'),
'url' => 'http://demo.wphoot.com/brigsby/',
'icon' => 'fa fa-eye' ),
'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' ),
) );
// Add Premium Infobutton
$hoot_customizer->add_infobuttons( array(
'premium' => array( 'text' => __( 'Premium', 'brigsby'),
'type' => 'premium',
'url' => 'http://wphoot.com/themes/brigsby/',
'icon' => 'fa fa-rocket' ),
) );
}
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' );
/**
* 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 = 55; // Replaces theme's logo_image // Update in premium if needed
$wp_customize->get_control( 'custom_logo' )->width = 250;
$wp_customize->get_control( 'custom_logo' )->height = 90;
// 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';
$wp_customize->get_section( 'background_image' )->panel = 'styling';
}
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( 'blogdescription' )->transport = 'postMessage';
}
add_action( 'customize_register', 'hoot_customizer_customize_register' );
/**
* Add theme specific option specific css
*
* @since 1.0
* @access public
* @return void
*/
function hoot_theme_customizer_inlinecss() {
echo '';
}
add_action( 'customize_controls_print_styles', 'hoot_theme_customizer_inlinecss' );
/**
* 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' || $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_show_primary_menuarea_custom( $control ) {
$selector = $control->manager->get_setting('primary_menuarea')->value();
return ( $selector == 'custom' ) ? 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 );
}