0 ) )
{
$items[1]->classes[] = 'active';
}
}
*
*/
return $items;
}
/**
* While in the Customizer, we might consider the use of a dummy menu
* in the case that no menu has been selected.
*
* @param type $markup The current markup for the menu
* @return type The markup for the menu, starting with
*/
function cz_change_nav_menu( $markup )
{
//DAN-NOTE: Not doing this just yet (or maybe never), but
// when ready to do so, uncomment the below block.
/*
// Ensure that we are in the Customizer - otherwise, do nothing special.
if ( \ski\question::is_customizer() )
{
// Only change out the menu to a sample if no menu has been defined/selected.
if ( empty( $markup ) )
{
$markup =
''.
'- '.
'Sample dropdown'.
''.
'
'.
'- Sample active
'.
'- '.__( 'Category', 'bpq' ).'';
}
// Making it here means that no change should have been made.
return $category;
}
/**
* Force specific content to appear on the post format mockups
* located in the sample template.
*
* Note: It is necessary to change the content in this manner
* because setting $post->post_content is not respected
* by WP's get_the_content() function.
*
* @param type $content The original content
* @return string The desired content
*/
function cz_change_sample_content( $content )
{
// Ensure that we are in the Customizer - otherwise, do nothing special.
if ( is_viewing_sample() )
{
global $sample;
return $sample->post_content;
}
// Making it here means that no change should have been made.
return $content;
}
/**
* Force a specific date to appear on the post format mockups
* located in the sample template.
*
* @param string $date The original date
* @param string $d Date format
* @return string The desired date
*/
function cz_change_sample_date( $date, $d )
{
// Ensure that we are in the Customizer - otherwise, do nothing special.
if ( is_viewing_sample() )
{
if ( empty( $d ) ) return mysql2date( get_option( 'date_format' ), time() );
else return mysql2date( $d, time() );
}
// Making it here means that no change should have been made.
return $date;
}
/**
* Force a specific tag to appear on the post format mockups
* located in the sample template.
*
* @param type $tag The original tag
* @return string The desired tag
*/
function cz_change_sample_tag( $tag )
{
// Ensure that we are in the Customizer - otherwise, do nothing special.
if ( is_viewing_sample() )
{
return ''.__( 'Tag', 'bpq' ).'';
}
// Making it here means that no change should have been made.
return $tag;
}
/**
* Shortcut for determining if a developer is on the Theme
* Customizer screen AND viewing the sample template.
*/
function is_viewing_sample()
{
if ( \ski\question::is_customizer() )
{
// OPTION: Preview
$opt_preview_template = get_theme_mod( 'bpq_opt_preview_template', 'front' );
return ( $opt_preview_template == 'sample' );
}
return false;
}
/**
* TABLE OF CONTENTS - Theme Customizer
*
* SECTION: Format
* SECTION: Alert
* SECTION: Tone
* SECTION: Typography
* SECTION: Buttons
* SECTION: Top bar
* SECTION: Masthead
* SECTION: Menubar
* SECTION: Sidebars
* SECTION: Pedestal
* SECTION: Bottom bar
*/
/**
* Alter existing options setup by WP.
*/
function cz_register( $wp_customize )
{
// Get rid of the site title/tagline and front page sections.
$wp_customize->remove_section( 'title_tagline' );
$wp_customize->remove_section( 'static_front_page' );
}
/**
* Registration of the Theme Customizer "Preview" section. This is a
* special section that appears before all other sections. It contains
* a single setting that allows a developer to select how they wish to
* preview their settings (thus, drives the choice of customizer template).
*
* Note: This section is the only section that starts a priority
* off NOT at a multiple of 1000.
*
* Note: The sample template is only available in the architect edition.
*
* SECTION: Preview
* OPTION: Which page to preview (checkbox, choices: sample elements, front page)
*/
function cz_register_section_preview( $wp_customize )
{
$premium_desc =
sprintf(
__(
'The %s edition includes a "sample" '.
'page specially made for viewing individual BluePrint-Q/Bootstrap elements. '.
'Upgrade today!',
'bpq'
),
welcome::url_pricing(),
sales::edition_name( 3 ),
sales::url_buy( 3 )
);
if ( BPQ_EDITION >= 3 )
{
$premium_desc =
__(
'Front pages are great for changing structure. BluePrint-Q also provides a '.
'"sample" page specially made for viewing individual elements.',
'bpq'
);
}
$wp_customize->add_section( 'bpq_cz_section_preview',
array(
'title' => __( 'Preview', 'bpq' ),
'description' => $premium_desc,
'priority' => 500
));
// LABEL: Template
$premium_choices = array( 'front' => __( 'Wordpress\' front page', 'bpq' ) );
if ( BPQ_EDITION >= 3 )
{
$premium_choices['sample'] = __( 'BluePrint-Q\'s sample elements', 'bpq' );
}
$wp_customize->add_setting( 'bpq_opt_preview_template', array( 'default' => 'front', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_text_ctl( $wp_customize, 'bpq_opt_preview_template',
array(
'label' => __( 'Page to view only here?', 'bpq' ),
'desc_after' => sprintf( __( 'Note: Your front page can be set from the reading settings screen.', 'bpq' ), admin_url( 'options-reading.php' ) ),
'section' => 'bpq_cz_section_preview',
'choices' => $premium_choices,
'priority' => 501
)));
}
/**
* Registration of the Theme Customizer "Format" section.
*
* SECTION: Format
* OPTION: Span (radio_image)
* CHOICE: Full bleed, wide content (checkbox)
* CHOICE: Full bleed, narrow content (checkbox)
* CHOICE: Boxed, narrow content (checkbox)
* LABEL: Header
* OPTION: Display alert? (checkbox)
* OPTION: Display top bar? (checkbox)
* OPTION: Display masthead? (checkbox)
* OPTION: Display navigation bar? (checkbox)
* LABEL: Sidebars
* OPTION: (sidebar_layout)
* LABEL: Footer
* OPTION: Display pedestal? (checkbox)
* OPTION: Display bottom bar? (checkbox)
*/
function cz_register_section_format( $wp_customize )
{
// SECTION: Format
$wp_customize->add_section( 'bpq_cz_section_format',
array(
'title' => __( 'Format', 'bpq' ),
'description' => __( 'Give your site an overall structure', 'bpq' ),
'priority' => 1000
));
// LABEL: Span
$wp_customize->add_setting( 'bpq_opt_format_site_span', array( 'default' => 'boxed-narrow', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_site_span_layout_ctl( $wp_customize, 'bpq_opt_format_site_span',
array(
'label' => __( 'Span', 'bpq' ),
'desc' => __( 'Select a layout for the site', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1100
)));
// LABEL: Header
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Header', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1200
)));
$wp_customize->add_setting( 'bpq_opt_format_display_alert', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
if ( BPQ_EDITION >= 2 )
{
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_alert',
array(
'option_text' => __( 'Display alert', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1210
)));
}
else
{
$upsell = sprintf(
__(
'The banner alert is available with the %s edition. '.
'Upgrade today!',
'bpq'
),
welcome::url_pricing(),
sales::edition_name( 2 ),
sales::url_buy( 2 )
);
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => $upsell,
'section' => 'bpq_cz_section_format',
'priority' => 1210
)));
}
$wp_customize->add_setting( 'bpq_opt_format_display_top', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_top',
array(
'option_text' => __( 'Display top bar', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1220
)));
$wp_customize->add_setting( 'bpq_opt_format_display_masthead', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_masthead',
array(
'option_text' => __( 'Display masthead', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1230
)));
$wp_customize->add_setting( 'bpq_opt_format_display_navigation', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_navigation',
array(
'option_text' => __( 'Display navigation bar', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1240
)));
// LABEL: Sidebars
$wp_customize->add_setting( 'bpq_opt_format_sidebar_layout', array( 'default' => 'r1', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_sidebar_layout_ctl( $wp_customize, 'bpq_opt_format_sidebar_layout',
array(
'label' => __( 'Sidebars', 'bpq' ),
'desc' => __( 'Select the layout and number of sidebars', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1300
)));
// LABEL: Footer
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Footer', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1400
)));
$wp_customize->add_setting( 'bpq_opt_format_display_pedestal', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_pedestal',
array(
'option_text' => __( 'Display pedestal', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1410
)));
$wp_customize->add_setting( 'bpq_opt_format_display_bottom', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
if ( BPQ_EDITION >= 2 )
{
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_format_display_bottom',
array(
'option_text' => __( 'Display bottom bar', 'bpq' ),
'section' => 'bpq_cz_section_format',
'priority' => 1420
)));
}
else
{
$upsell = sprintf(
__(
'The bottom bar is available with the %s edition. '.
'Upgrade today!',
'bpq'
),
welcome::url_pricing(),
sales::edition_name( 2 ),
sales::url_buy( 2 )
);
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => $upsell,
'section' => 'bpq_cz_section_format',
'priority' => 1420
)));
}
}
/**
* Registration of the Theme Customizer "Top" section.
*
* SECTION: Profile
* LABEL: Contact info
* OPTION: Phone number (textbox)
* OPTION: Fax number (textbox)
* OPTION: E-mail address (textbox)
* OPTION: Street address (textbox)
* OPTION: Business hours (textbox)
* OPTION: General info (textbox)
* LABEL: Social
* OPTION: Facebook (textbox)
* OPTION: Twitter (textbox)
* OPTION: Google+ (textbox)
* OPTION: Pinterest (textbox)
* OPTION: LinkedIn (textbox)
* LABEL: Divider
* LABEL: Extra 1
* OPTION: Title (textbox)
* OPTION: Icon (textbox)
* OPTION: URL (textbox)
* LABEL: Extra 2
* OPTION: Title (textbox)
* OPTION: Icon (textbox)
* OPTION: URL (textbox)
* LABEL: Extra 3
* OPTION: Title (textbox)
* OPTION: Icon (textbox)
* OPTION: URL (textbox)
*/
function cz_register_section_profile( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_profile',
array(
'title' => __( 'Profile', 'bpq' ),
'description' => __( 'Information here can be used on the site through widgets, plugins, etc.', 'bpq' ),
'priority' => 2000
));
// Contact info
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Contact info', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2100
)));
$wp_customize->add_setting( 'bpq_opt_profile_phone', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_phone',
array(
'desc' => __( ' Phone number', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2110
)));
$wp_customize->add_setting( 'bpq_opt_profile_fax', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_fax',
array(
'desc' => __( ' Fax number', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2120
)));
$wp_customize->add_setting( 'bpq_opt_profile_email', array( 'default' => '', 'sanitize_callback' => '\sanitize_email' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_email',
array(
'desc' => __( ' E-mail address', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2130
)));
$wp_customize->add_setting( 'bpq_opt_profile_street', array( 'default' => '', 'sanitize_callback' => '\sanitize_email' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_street',
array(
'desc' => __( ' Street address', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2140
)));
$wp_customize->add_setting( 'bpq_opt_profile_hours', array( 'default' => '', 'sanitize_callback' => '\sanitize_email' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_hours',
array(
'desc' => __( ' Business hours', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2150
)));
$wp_customize->add_setting( 'bpq_opt_profile_info', array( 'default' => '', 'sanitize_callback' => '\sanitize_email' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_info',
array(
'desc' => __( ' General info', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2160
)));
// Social info
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Social info', 'bpq' ),
'desc' => __( 'Provide URLs to your pages on these popular social networking sites.', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2200
)));
$wp_customize->add_setting( 'bpq_opt_profile_facebook', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_facebook',
array(
'desc' => __( ' Facebook community page', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2210
)));
$wp_customize->add_setting( 'bpq_opt_profile_google', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_google',
array(
'desc' => __( ' Google+ page', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2220
)));
$wp_customize->add_setting( 'bpq_opt_profile_linkedin', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_linkedin',
array(
'desc' => __( ' LinkedIn profile', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2230
)));
$wp_customize->add_setting( 'bpq_opt_profile_pinterest', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_pinterest',
array(
'desc' => __( ' Pinterest pinboard', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2240
)));
$wp_customize->add_setting( 'bpq_opt_profile_twitter', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_profile_twitter',
array(
'desc' => __( ' Twitter tweets', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2250
)));
// Extras
$wp_customize->add_control( new \ski\cz_divider_1_ctl( $wp_customize, '',
array(
'section' => 'bpq_cz_section_profile',
'priority' => 2300
)));
$desc = sprintf(
__(
'Not seeing quite what you want here? Do not despair — the %s edition '.
'extends the profile information with icons, titles, and URLs. Upgrade today!',
'bpq'
),
welcome::url_pricing(),
sales::edition_name( 3 ),
sales::url_buy( 3 )
);
if ( BPQ_EDITION >= 3 )
{
$desc = sprintf(
__(
'You can extend the profile with icons, titles, and URLs. Use only the short names of the '.
'icons (e.g. fa-star) instead of the full markup from Font Awesome.',
'bpq'
),
'http://fortawesome.github.io/Font-Awesome/icons/'
);
}
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => $desc,
'section' => 'bpq_cz_section_profile',
'priority' => 2310
)));
for ( $i = 0; $i < constant( 'BPQ_PROFILE_NUM_EXTRAS' ); $i++ )
{
$setting_prefix = sprintf( 'bpq_opt_profile_extra%d', ( $i + 1 ) );
$wp_customize->add_setting( $setting_prefix.'_icon', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_setting( $setting_prefix.'_title', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_setting( $setting_prefix.'_url', array( 'default' => '', 'sanitize_callback' => '\esc_url_raw' ) );
if ( BPQ_EDITION >= 3 )
{
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => sprintf( __( 'Extra #%d', 'bpq' ), ( $i + 1 ) ),
'section' => 'bpq_cz_section_profile',
'priority' => 2400 + ( $i * 100 )
)));
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, $setting_prefix.'_icon',
array(
'desc' => __( 'Icon', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2410 + ( $i * 100 )
)));
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, $setting_prefix.'_title',
array(
'desc' => __( 'Title', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2420 + ( $i * 100 )
)));
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, $setting_prefix.'_url',
array(
'desc' => __( 'URL', 'bpq' ),
'section' => 'bpq_cz_section_profile',
'priority' => 2430 + ( $i * 100 )
)));
}
}
}
/**
* Registration of the Theme Customizer "Alert" section.
*
* SECTION: Alert
* LABEL: Text
* OPTION: Headline (textbox)
* OPTION: Caption (textbox)
* OPTION: Alignment (radio_image_horizontal_alignment)
* LABEL: Classification
* OPTION: (dropdown choices: Info, Success, Warning, Danger)
* OPTION: User can dismiss the alert? (checkbox)
*/
function cz_register_section_alert( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_alert',
array(
'title' => __( 'Alert', 'bpq' ),
'description' => __( 'Call out an important message to your visitors', 'bpq' ),
'priority' => 3000
));
// Headline
$wp_customize->add_setting( 'bpq_opt_alert_headline', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_alert_headline',
array(
'label' => __( 'Headline', 'bpq' ),
'desc' => __( 'This text will be boldfaced', 'bpq' ),
'section' => 'bpq_cz_section_alert',
'priority' => 3100
)));
// Caption
$wp_customize->add_setting( 'bpq_opt_alert_caption', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_alert_caption',
array(
'label' => __( 'Caption', 'bpq' ),
'desc' => __( 'This text will not be boldfaced', 'bpq' ),
'section' => 'bpq_cz_section_alert',
'priority' => 3200
)));
// Text alignment
$wp_customize->add_setting( 'bpq_opt_alert_alignment', array( 'default' => 'mc', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_alert_alignment',
array(
'label' => __( 'Alignment', 'bpq' ),
'section' => 'bpq_cz_section_alert',
'priority' => 3300
)));
// Classification
$wp_customize->add_setting( 'bpq_opt_alert_color', array( 'default' => 'alert-warning', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_alert_color',
array(
'label' => __( 'Classification', 'bpq' ),
'section' => 'bpq_cz_section_alert',
'choices' =>
array(
'alert-info' => 'Info',
'alert-success' => 'Success',
'alert-warning' => 'Warning',
'alert-danger' => 'Danger'
),
'priority' => 3400
)));
$wp_customize->add_setting( 'bpq_opt_alert_dismissable', array( 'default' => true, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_alert_dismissable',
array(
'option_text' => __( 'User can dismiss the alert', 'bpq' ),
'section' => 'bpq_cz_section_alert',
'priority' => 3410
)));
}
/**
* Registration of the Theme Customizer "Tone" section.
*
* SECTION: Tone
* OPTION: Color scheme (dropdown list of all color-related css)
* OPTION: Style scheme (dropdown list of all falir-related css)
* OPTION: Type scheme (dropdown list of all type-related css)
*/
function cz_register_section_tone( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_tone',
array(
'title' => __( 'Tones', 'bpq' ),
'priority' => 4000
));
// Shortcut path pattern to the BPQ tones - remove the
// root so the tone works on any local/remote server.
$color_loc = 'tones/colors/bpq.tone.color.%s.css';
$flair_loc = 'tones/flairs/bpq.tone.flair.%s.css';
$type_loc = 'tones/types/bpq.tone.type.%s.css';
// Prepare the lists of tones - these will appear in any edition.
$colors = array(
sprintf( $color_loc, 'bootstrap' ) => __( 'Bootstrap', 'bpq' ),
sprintf( $color_loc, 'gradient-blues' ) => __( 'Gradient Blues', 'bpq' ),
sprintf( $color_loc, 'zen-garden' ) => __( 'Zen Garden', 'bpq' ),
);
$flairs = array(
sprintf( $flair_loc, 'architect' ) => __( 'Architect', 'bpq' ),
sprintf( $flair_loc, 'blockhead' ) => __( 'Blockhead', 'bpq' ),
sprintf( $flair_loc, 'bootstrap' ) => __( 'Bootstrap', 'bpq' ),
sprintf( $flair_loc, 'merry-go-round' ) => __( 'Merry-go-Round', 'bpq' ),
);
$types = array(
sprintf( $type_loc, 'bootstrap' ) => __( 'Bootstrap', 'bpq' ),
sprintf( $type_loc, 'funhouse' ) => __( 'Funhouse', 'bpq' ),
sprintf( $type_loc, 'happy-hour' ) => __( 'Happy Hour', 'bpq' ),
sprintf( $type_loc, 'magazine-digest' ) => __( 'Magazine Digest', 'bpq' ),
sprintf( $type_loc, 'soundwave' ) => __( 'Soundwave', 'bpq' ),
);
// Add more tones if using the architect edition.
if ( BPQ_EDITION >= 2 )
{
$colors_architect = array(
sprintf( $color_loc, 'calm-of-the-sea' ) => __( 'Calm of the Sea', 'bpq' ),
sprintf( $color_loc, 'cherry-cheesecake' ) => __( 'Cherry Cheesecake', 'bpq' ),
sprintf( $color_loc, 'granny-smith-apple' ) => __( 'Granny Smith Apple', 'bpq' ),
sprintf( $color_loc, 'iceberg' ) => __( 'Iceberg', 'bpq' ),
sprintf( $color_loc, 'purple-rain' ) => __( 'Purple Rain', 'bpq' ),
);
$colors = array_merge( $colors, $colors_architect );
$flairs_architect = array(
sprintf( $flair_loc, 'french-fried' ) => __( 'French Fried', 'bpq' ),
sprintf( $flair_loc, 'minimalist' ) => __( 'Minimalist', 'bpq' ),
sprintf( $flair_loc, 'movie-strip' ) => __( 'Movie Strip', 'bpq' ),
sprintf( $flair_loc, 'radioactive' ) => __( 'Radioactive', 'bpq' ),
);
$flairs = array_merge( $flairs, $flairs_architect );
$types_architect = array(
sprintf( $type_loc, 'circular-logic' ) => __( 'Circular Logic', 'bpq' ),
sprintf( $type_loc, 'seafarer' ) => __( 'Seafarer', 'bpq' ),
sprintf( $type_loc, 'symphony' ) => __( 'Symphony', 'bpq' ),
);
$types = array_merge( $types, $types_architect );
}
// Add more tones if using the premium edition.
if ( BPQ_EDITION >= 3 )
{
$colors_premium = array(
sprintf( $color_loc, 'afternoon-chai' ) => __( 'Afternoon Chai', 'bpq' ),
sprintf( $color_loc, 'beachside-shopping' ) => __( 'Beachside Shopping', 'bpq' ),
sprintf( $color_loc, 'business-casual' ) => __( 'Business Casual', 'bpq' ),
sprintf( $color_loc, 'campfire' ) => __( 'Campfire', 'bpq' ),
sprintf( $color_loc, 'circus' ) => __( 'Circus', 'bpq' ),
sprintf( $color_loc, 'pink-peppermint' ) => __( 'Pink Peppermint', 'bpq' ),
sprintf( $color_loc, 'salmon-on-ice' ) => __( 'Salmon on Ice', 'bpq' ),
);
$colors = array_merge( $colors, $colors_premium );
$flairs_premium = array(
sprintf( $flair_loc, 'capsule' ) => __( 'Capsule', 'bpq' ),
sprintf( $flair_loc, 'flagstaff' ) => __( 'Flagstaff', 'bpq' ),
sprintf( $flair_loc, 'glowstick' ) => __( 'Glowstick', 'bpq' ),
sprintf( $flair_loc, 'gridiron' ) => __( 'Gridiron', 'bpq' ),
sprintf( $flair_loc, 'iapp' ) => __( 'iApp', 'bpq' ),
sprintf( $flair_loc, 'porthole' ) => __( 'Porthole', 'bpq' ),
sprintf( $flair_loc, 'weeping-willow' ) => __( 'Weeping Willow', 'bpq' ),
);
$flairs = array_merge( $flairs, $flairs_premium );
$types_premium = array(
sprintf( $type_loc, '8-bit' ) => __( '8-Bit', 'bpq' ),
sprintf( $type_loc, 'artistic-license' ) => __( 'Artistic License', 'bpq' ),
sprintf( $type_loc, 'charitable-contribution' ) => __( 'Charitable Contribution', 'bpq' ),
sprintf( $type_loc, 'clean-tek' ) => __( 'Clean Tek', 'bpq' ),
sprintf( $type_loc, 'concrete-slab' ) => __( 'Concrete Slab', 'bpq' ),
sprintf( $type_loc, 'electronic-reader' ) => __( 'Electronic Reader', 'bpq' ),
sprintf( $type_loc, 'fashionista' ) => __( 'Fashionista', 'bpq' ),
sprintf( $type_loc, 'fruit-basket' ) => __( 'Fruit Basket', 'bpq' ),
sprintf( $type_loc, 'hot-air-balloon' ) => __( 'Hot-Air Balloon', 'bpq' ),
sprintf( $type_loc, 'lake-eerie' ) => __( 'Lake "Eerie"', 'bpq' ),
sprintf( $type_loc, 'loonie-toonie' ) => __( 'Loonie Toonie', 'bpq' ),
sprintf( $type_loc, 'nervous-nellie' ) => __( 'Nervous Nellie', 'bpq' ),
sprintf( $type_loc, 'poetic-justice' ) => __( 'Poetic Justice', 'bpq' ),
sprintf( $type_loc, 'showstopper' ) => __( 'Showstopper', 'bpq' ),
sprintf( $type_loc, 'statement' ) => __( 'Statement', 'bpq' ),
sprintf( $type_loc, 'superfriends' ) => __( 'Superfriends', 'bpq' ),
);
$types = array_merge( $types, $types_premium );
}
// See if the child theme has any tones to add to the lists -
// only look for extending the list in architect edition.
if ( BPQ_EDITION >= 3 )
{
$colors = apply_filters( 'filter_bpq_tone_color_list', $colors );
$flairs = apply_filters( 'filter_bpq_tone_flair_list', $flairs );
$types = apply_filters( 'filter_bpq_tone_type_list', $types );
}
// Note: asort() places 'iApp' at the end because it is case-sensitive. There is a solution
// using uasort() and strcasecmp() to sort being case-insensitive. Solution here:
// http://board.phpbuilder.com/showthread.php?10185890-Case-insensitive-asort
uasort( $colors, '\strcasecmp' );
uasort( $flairs, '\strcasecmp' );
uasort( $types, '\strcasecmp' );
// There is potential to have notices displayed under each tone dropdown.
$notice_colors = sprintf( __( 'Upgrade to the %s Edition and work with many more gorgeous color palettes.' ), sales::url_buy( 2 ), sales::edition_name( 2 ) );
$notice_flairs = sprintf( __( 'Upgrade to the %s Edition and work with many more exciting flairs.' ), sales::url_buy( 2 ), sales::edition_name( 2 ) );
$notice_types = sprintf( __( 'Upgrade to the %s Edition and work with many more sharp typography pairings.' ), sales::url_buy( 2 ), sales::edition_name( 2 ) );
if ( BPQ_EDITION >= 2 )
{
$notice_colors = $notice_flairs = $notice_types = '';
}
// Color.
$wp_customize->add_setting( 'bpq_opt_tone_color', array( 'default' => sprintf( $color_loc, 'gradient-blues' ), 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_tone_color',
array(
'label' => __( ' Color', 'bpq' ),
'desc' => __( 'Many palettes are derived from the top listings shared at Adobe Kuler.', 'bpq' ),
'desc_after' => $notice_colors,
'choices' => $colors,
'section' => 'bpq_cz_section_tone',
'priority' => 4100
)));
// Flair.
$wp_customize->add_setting( 'bpq_opt_tone_flair', array( 'default' => sprintf( $flair_loc, 'architect' ), 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_tone_flair',
array(
'label' => __( ' Flair', 'bpq' ),
'desc' => __( 'Shapes the elements that make up the frame - can include borders, spacing, etc.', 'bpq' ),
'desc_after' => $notice_flairs,
'choices' => $flairs,
'section' => 'bpq_cz_section_tone',
'priority' => 4200
)));
// Typography.
$wp_customize->add_setting( 'bpq_opt_tone_type', array( 'default' => sprintf( $type_loc, 'soundwave' ), 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_tone_type',
array(
'label' => __( ' Typography', 'bpq' ),
'desc' => __( 'Heading/body combinations hand-selected from the Google Fonts library.', 'bpq' ),
'desc_after' => $notice_types,
'choices' => $types,
'section' => 'bpq_cz_section_tone',
'priority' => 4300
)));
}
/**
* Registration of the Theme Customizer "Top" section.
*
* SECTION: Top (visible: Format > Header > Display top bar)
* OPTION: Alignment (radio_image_horizontal_alignment)
*/
function cz_register_section_top( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_top',
array(
'title' => __( 'Top Bar', 'bpq' ),
'description' => __( 'An area at the top that can help frame the site and offer information', 'bpq' ),
'priority' => 5000
));
// Alignment
$wp_customize->add_setting( 'bpq_opt_top_alignment', array( 'default' => 'mc', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_top_alignment',
array(
'label' => __( 'Alignment', 'bpq' ),
'section' => 'bpq_cz_section_top',
'priority' => 5100
)));
// Notices
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => __( 'Note: Widgets can be altered by expanding the corresponding section.', 'bpq' ),
'section' => 'bpq_cz_section_top',
'priority' => 5200
)));
}
/**
* Registration of the Theme Customizer "Masthead" section.
*
* SECTION: Masthead (visible: Format > Header > Display masthead)
* OPTION: Purpose (radio_text)
* CHOICE: Logo
* OPTION: (media_selector)
* OPTION: Size (number_bar range: +5 to +95)
* CHOICE: Title & Tagline
* OPTION: Title (textbox)
* OPTION: Tagline (textbox)
* OPTION: One line or two (checkbox)
* OPTION: Alignment (radio_image_horizontal_alignment)
*/
function cz_register_section_masthead( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_masthead',
array(
'title' => __( 'Masthead', 'bpq' ),
'description' => __( 'A large horizontal area typically for a design', 'bpq' ),
'priority' => 6000
));
// Purpose
$wp_customize->add_setting( 'bpq_opt_masthead_purpose', array( 'default' => 'image', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_text_ctl( $wp_customize, 'bpq_opt_masthead_purpose',
array(
'label' => __( 'Purpose', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'choices' =>
array(
'image' => __( ' Image/logo', 'bpq' ),
'text' => __( ' Title and tagline', 'bpq' ),
),
'priority' => 6100
)));
$wp_customize->add_setting( 'bpq_opt_masthead_image', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_media_library_ctl( $wp_customize, 'bpq_opt_masthead_image',
array(
'section' => 'bpq_cz_section_masthead',
'priority' => 6110
)));
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'blogname',
array(
'placeholder' => __( 'Blog title', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6120
)));
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'blogdescription',
array(
'placeholder' => __( 'Blog description', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6130
)));
$wp_customize->add_setting( 'bpq_opt_masthead_single_line', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_masthead_single_line',
array(
'option_text' => __( 'Display on a single line', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6140
)));
// Layout
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Layout', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6200
)));
$wp_customize->add_setting( 'bpq_opt_masthead_hide_mobile', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_masthead_hide_mobile',
array(
'option_text' => __( 'Hide masthead on mobile devices', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6210
)));
$wp_customize->add_setting( 'bpq_opt_masthead_use_widgets', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_masthead_use_widgets',
array(
'option_text' => __( 'Split the masthead', 'bpq' ),
'desc_after' => __( 'Note: By splitting the masthead, you can display widgets alongside your logo.', 'bpq' ),
'section' => 'bpq_cz_section_masthead',
'priority' => 6220
)));
}
/**
* Registration of the Theme Customizer "Navigation" section.
*
* SECTION: Navigation (visible: Format > Header > Display navigation bar)
* OPTION: Menu (drop_menu)
* OPTION: Brand (radio_text)
* CHOICE: Logo
* OPTION: (media_selector)
* OPTION: Vertical offset (number_bar -50/+50)
* CHOICE: Title
* OPTION: Title (textbox note: same as the one in the Masthead section)
* OPTION: Hide on mobile
* LABEL: Additional buttons
* OPTION: Cart (checkbox)
* OPTION: Login (checkbox)
* OPTION: Search (checkbox)
* OPTION: Scheme (dropdown choices: light, dark)
*/
function cz_register_section_navigation( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_navigation',
array(
'title' => __( 'Navigation', 'bpq' ),
'description' => __( 'The main navigation area for your site', 'bpq' ),
'priority' => 7000
));
// Menu
$wp_customize->add_setting( 'bpq_opt_navigation_menu', array( 'default' => 'none', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_menus_ctl( $wp_customize, 'bpq_opt_navigation_menu',
array(
'label' => __( 'Menu', 'bpq' ),
'desc_after' => sprintf( __( 'You can create/delete menus on the Edit Menus screen.', 'bpq' ), admin_url( 'nav-menus.php' ) ),
'none' => __( '- None -', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7100
)));
// Brand
$wp_customize->add_setting( 'bpq_opt_navigation_purpose', array( 'default' => 'text', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_text_ctl( $wp_customize, 'bpq_opt_navigation_purpose',
array(
'label' => __( 'Brand', 'bpq' ),
'choices' =>
array(
'logo' => __( ' Logo', 'bpq' ),
'text' => __( ' Text', 'bpq' )
),
'section' => 'bpq_cz_section_navigation',
'priority' => 7200
)));
$wp_customize->add_setting( 'bpq_opt_navigation_logo', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_media_library_ctl( $wp_customize, 'bpq_opt_navigation_logo',
array(
'desc' => __( 'Logo', 'bpq' ),
'desc_after' => __( 'Larger images will be resized to 300x100', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7210
)));
$wp_customize->add_setting( 'bpq_opt_navigation_logo_offset', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_number_bar_ctl( $wp_customize, 'bpq_opt_navigation_logo_offset',
array(
'desc' => __( 'Offset', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'display' => 'none',
'min' => -25,
'max' => 25,
'step' => 1,
'priority' => 7220
)));
$wp_customize->add_setting( 'bpq_opt_navigation_brand_text', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_navigation_brand_text',
array(
'placeholder' => __( 'Your brand text goes here', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7230
)));
$wp_customize->add_setting( 'bpq_opt_navigation_hide_mobile', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_hide_mobile',
array(
'desc' => __( 'Tiny viewports can feel crowded.', 'bpq' ),
'option_text' => __( 'Hide brand on mobile devices', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7240
)));
// Additional buttons
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'More buttons', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7300
)));
$wp_customize->add_setting( 'bpq_opt_navigation_display_cart', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$woo_warning = '';
if ( !\ski\question::is_plugin_active( 'woocommerce/woocommerce.php' ) ) $woo_warning = __( 'Requires WooCommerce activation', 'bpq' );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_display_cart',
array(
'desc_after' => $woo_warning,
'option_text' => __( ' Display cart', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7310
)));
$wp_customize->add_setting( 'bpq_opt_navigation_display_login', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_display_login',
array(
'option_text' => __( ' Display login', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7320
)));
$wp_customize->add_setting( 'bpq_opt_navigation_display_search', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_display_search',
array(
'option_text' => __( ' Display search', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7330
)));
// Scheme
$wp_customize->add_setting( 'bpq_opt_navigation_scheme', array( 'default' => 'tone', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_navigation_scheme',
array(
'label' => __( 'Scheme', 'bpq' ),
'desc_after' => __( 'BluePrint-Q Tone will use the options you have specified in the Tone section.', 'bpq' ),
'choices' =>
array(
'navbar-default' => 'Bootstrap Light',
'navbar-inverse' => 'Bootstrap Dark',
'tone' => 'BluePrint-Q Tone'
),
'section' => 'bpq_cz_section_navigation',
'priority' => 7400
)));
// Behavior
$wp_customize->add_setting( 'bpq_opt_navigation_affix', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_affix',
array(
'label' => __( 'Behavior', 'bpq' ),
'option_text' => __( 'Affix when scrolled offscreen', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7500
)));
$wp_customize->add_setting( 'bpq_opt_navigation_animate', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_navigation_animate',
array(
'option_text' => __( 'Execute animations', 'bpq' ),
'section' => 'bpq_cz_section_navigation',
'priority' => 7510
)));
}
/**
* Registration of the Theme Customizer "Content" section.
*
* SECTION: Content
* LABEL: General
* OPTION: Use 'read more' links (checkbox)
* OPTION: Display breadcrumbs (checkbox)
* OPTION: Bring stickies to the top (checkbox)
* OPTION: Alignment (radio_image_horizontal_alignment)
* LABEL: Paging
* OPTION: Display above blog (checkbox)
* OPTION: Display below blog (checkbox)
* OPTION: Display train (checkbox)
* OPTION: Train length (number_bar, range 0 - +7, visible when Display train is checked)
* LABEL: Featured image
* OPTION: Display on archive pages (drop: above, left, right, none)
* OPTION: Display on single pages (drop: above, left, right, none)
* LABEL: Post metadata
* OPTION: Display author (checkbox)
* OPTION: Display categories (checkbox)
* OPTION: Display comments (checkbox)
* OPTION: Display date (checkbox)
* OPTION: Date link type (drop: daily, monthly, yearly, visible when Display date is checked)
* OPTION: Display tags (checkbox)
*/
function cz_register_section_content( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_content',
array(
'title' => __( 'Content', 'bpq' ),
'description' => __( 'Primarily focused on posts/pages', 'bpq' ),
'priority' => 8000
));
// General
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'General', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8100
)));
$wp_customize->add_setting( 'bpq_opt_content_read_more', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_read_more',
array(
'option_text' => __( ' Use *read more* links', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8110
)));
$wp_customize->add_setting( 'bpq_opt_content_read_more_text', array( 'default' => '', 'sanitize_callback' => '\sanitize_text_field' ) );
$wp_customize->add_control( new \ski\cz_textbox_ctl( $wp_customize, 'bpq_opt_content_read_more_text',
array(
'desc_after' => __( 'Leave blank to use the default text', 'bpq' ),
'placeholder' => __( 'Change *read more* text?', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8120
)));
$wp_customize->add_setting( 'bpq_opt_content_breadcrumbs', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_breadcrumbs',
array(
'option_text' => __( ' Breadcrumbs', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8130
)));
$wp_customize->add_setting( 'bpq_opt_content_stickies', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_stickies',
array(
'option_text' => __( ' Bring stickies to the top', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8140
)));
$wp_customize->add_setting( 'bpq_opt_content_highlight_alignment', array( 'default' => 'mc', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_content_highlight_alignment',
array(
'desc' => __( 'Highlight alignment', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8150
)));
$wp_customize->add_setting( 'bpq_opt_content_article_alignment', array( 'default' => 'ml', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_content_article_alignment',
array(
'desc' => __( 'Article alignment', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8160
)));
// Post metadata
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Metadata', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8200
)));
$wp_customize->add_setting( 'bpq_opt_content_display_author', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_display_author',
array(
'option_text' => __( ' Display author', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8210
)));
$wp_customize->add_setting( 'bpq_opt_content_display_categories', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_display_categories',
array(
'option_text' => __( ' Display categories', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8220
)));
$wp_customize->add_setting( 'bpq_opt_content_display_comments', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_display_comments',
array(
'option_text' => __( ' Display comments', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8230
)));
$wp_customize->add_setting( 'bpq_opt_content_display_date', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_display_date',
array(
'option_text' => __( ' Display date', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8240
)));
$wp_customize->add_setting( 'bpq_opt_content_date_archive_type', array( 'default' => 'month', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_content_date_archive_type',
array(
'choices' =>
array(
'day' => 'Link to the daily archive',
'month' => 'Link to the monthly archive',
'year' => 'Link to the yearly archive'
),
'section' => 'bpq_cz_section_content',
'priority' => 8250
)));
$wp_customize->add_setting( 'bpq_opt_content_display_tags', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_display_tags',
array(
'option_text' => __( ' Display tags', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8260
)));
// Paging
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Paging', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8300
)));
$wp_customize->add_setting( 'bpq_opt_content_paging_above', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_paging_above',
array(
'option_text' => __( 'Display above blog', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8310
)));
$wp_customize->add_setting( 'bpq_opt_content_paging_below', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_paging_below',
array(
'option_text' => __( 'Display below blog', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8320
)));
$wp_customize->add_setting( 'bpq_opt_content_paging_train', array( 'default' => 1, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_content_paging_train',
array(
'option_text' => __( 'Display page-link train', 'bpq' ),
'section' => 'bpq_cz_section_content',
'priority' => 8330
)));
$wp_customize->add_setting( 'bpq_opt_content_paging_train_size', array( 'default' => 2, 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_number_bar_ctl( $wp_customize, 'bpq_opt_content_paging_train_size',
array(
'section' => 'bpq_cz_section_content',
'display' => 'range',
'min' => 0,
'min_text' => 'less',
'max' => 7,
'max_text' => 'more',
'step' => 1,
'priority' => 8340
)));
}
/**
* Registration of the Theme Customizer "Sidebars" section.
*
* SECTION: Sidebars (visible: Format > Sidebars > Anything but 0)
* OPTION: Alignment (radio_image_horizontal_alignment)
*/
function cz_register_section_sidebars( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_sidebars',
array(
'title' => __( 'Sidebars', 'bpq' ),
'description' => __( 'Additional column(s) that contain supplemental info.', 'bpq' ),
'priority' => 9000
));
// Display
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Display', 'bpq' ),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9100
)));
$wp_customize->add_setting( 'bpq_opt_sidebars_hide_mobile_left', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_sidebars_hide_mobile_left',
array(
'option_text' => __( 'Hide left sidebars on mobile devices', 'bpq' ),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9110
)));
$wp_customize->add_setting( 'bpq_opt_sidebars_hide_mobile_right', array( 'default' => 0, 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_sidebars_hide_mobile_right',
array(
'option_text' => __( 'Hide right sidebars on mobile devices', 'bpq' ),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9120
)));
// Size
$wp_customize->add_setting( 'bpq_opt_sidebars_size', array( 'default' => '3', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_sidebars_size',
array(
'label' => __( 'Size', 'bpq' ),
'choices' =>
array(
'3' => '- Default -',
'2' => 'Shorter width',
'4' => 'Larger width',
),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9200
)));
// Alignment
$wp_customize->add_setting( 'bpq_opt_sidebars_alignment', array( 'default' => 'ml', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_sidebars_alignment',
array(
'label' => __( 'Alignment', 'bpq' ),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9300
)));
// Notices
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => __( 'Note: Widgets can be altered by expanding the corresponding section.', 'bpq' ),
'section' => 'bpq_cz_section_sidebars',
'priority' => 9400
)));
}
/**
* Registration of the Theme Customizer "Pedestal" section.
*
* SECTION: Pedestal (visible: Format > Footer > Pedestal)
* LABEL: Number of sections
* OPTION: (drop 1, 2, 3, 4, 6)
* OPTION: Alignment (radio_image_horizontal_alignment)
*/
function cz_register_section_pedestal( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_pedestal',
array(
'title' => __( 'Pedestal', 'bpq' ),
'description' => __( 'A large space that can anchor the site typically with social connections, newsletter sign-ups, etc', 'bpq' ),
'priority' => 10000
));
// Number of sections
$wp_customize->add_setting( 'bpq_opt_pedestal_sections', array( 'default' => '3', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_drop_ctl( $wp_customize, 'bpq_opt_pedestal_sections',
array(
'label' => __( 'Number of widgetized areas', 'bpq' ),
'choices' =>
array(
'1' => '1 @ 100% full width',
'2' => '2 @ 50% width each',
'3' => '3 @ 33% width each',
'4' => '4 @ 25% width each',
'6' => '6 @ 17% width each',
),
'section' => 'bpq_cz_section_pedestal',
'priority' => 10100
)));
// Alignment
$wp_customize->add_setting( 'bpq_opt_pedestal_align', array( 'default' => 'mc', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_pedestal_align',
array(
'label' => __( 'Alignment', 'ski' ),
'section' => 'bpq_cz_section_pedestal',
'priority' => 10200
)));
// LABEL: How-to
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => __( 'Tip: To add content, please either use the corresponding widget sections or '.
'visit the widgets page',
'bpq' ),
'section' => 'bpq_cz_section_pedestal',
'priority' => 10300
)));
}
/**
* Registration of the Theme Customizer "Bottom" section.
*
* SECTION: Bottom (visible: Format > Header > Display bottom bar)
* OPTION: Alignment (radio_image_horizontal_alignment)
*/
function cz_register_section_bottom( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_bottom',
array(
'title' => __( 'Bottom Bar', 'bpq' ),
'description' => __( 'An area at the bottom that can help frame the site and offer information', 'bpq' ),
'priority' => 11000
));
$notice =
sprintf(
__(
'The %s edition enables the use of widgets '.
'in this bottom bar. Upgrade today!',
'bpq'
),
welcome::url_pricing(),
sales::edition_name( 2 ),
sales::url_buy( 2 )
);
if ( BPQ_EDITION >= 2 )
{
$notice = __( 'Note: Widgets can be altered by expanding the corresponding section.', 'bpq' );
}
// Alignment - do not show with the freebie
if ( BPQ_EDITION >= 2 )
{
$wp_customize->add_setting( 'bpq_opt_bottom_alignment', array( 'default' => 'mc', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_radio_image_align_x_ctl( $wp_customize, 'bpq_opt_bottom_alignment',
array(
'label' => __( 'Alignment', 'bpq' ),
'section' => 'bpq_cz_section_bottom',
'priority' => 11100
)));
}
// Notices - changes based on the edition
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => $notice,
'section' => 'bpq_cz_section_bottom',
'priority' => 11200
)));
}
/**
* Registration of the Theme Customizer "Auxiliary" section.
*
* SECTION: Auxiliary
* OPTION: Browser Icon (media_library)
* OPTION: Google Analytics (textarea)
*/
function cz_register_section_auxiliary( $wp_customize )
{
$wp_customize->add_section( 'bpq_cz_section_auxiliary',
array(
'title' => __( 'Auxiliary', 'bpq' ),
'description' => __( 'Additional options for the overall site', 'bpq' ),
'priority' => 12000
));
// Favicon
$wp_customize->add_setting( 'bpq_opt_auxiliary_favicon', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
$wp_customize->add_control( new \ski\cz_media_library_ctl( $wp_customize, 'bpq_opt_auxiliary_favicon',
array(
'label' => __( 'Browser Icon', 'bpq' ),
'desc' => __( 'The icon selected here is typically displayed in a browser\'s tab.', 'bpq' ),
'desc_after' => __( 'Note: PNG files under 64 pixels work best.', 'bpq' ),
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12100
)));
// Analytics
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'label' => __( 'Analytics', 'bpq' ),
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12200
)));
$wp_customize->add_setting( 'bpq_opt_auxiliary_analytics', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'none' ) ) );
if ( BPQ_EDITION >= 3 )
{
$wp_customize->add_control( new \ski\cz_text_area_ctl( $wp_customize, 'bpq_opt_auxiliary_analytics',
array(
'desc' => sprintf( __( 'Google Analytics offers some great insights on your visitors\' behavior.', 'bpq' ), 'http://www.google.com/analytics/' ),
'desc_after' => __( 'Note: Paste the tracking script block that your Analytics account provides without the surrounding <script> tags.', 'bpq' ),
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12300
)));
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => __( 'Attention Developers — To avoid false positives, you can turn off Analytics tracking by turning on WP_DEBUG.', 'bpq' ),
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12310
)));
}
else
{
$upsell = sprintf(
__(
'Track your visitors\' behavior with Google Analytics. '.
'It is available with the %s edition. '.
'Upgrade today!',
'bpq'
),
'http://www.google.com/analytics/',
welcome::url_pricing(),
sales::edition_name( 3 ),
sales::url_buy( 3 )
);
$wp_customize->add_control( new \ski\cz_detail_ctl( $wp_customize, '',
array(
'desc' => $upsell,
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12300
)));
}
// Login
$wp_customize->add_setting( 'bpq_opt_auxiliary_login_force_redirect', array( 'default' => '', 'sanitize_callback' => array( '\ski\sanitize', 'checkbox' ) ) );
$wp_customize->add_control( new \ski\cz_checkbox_ctl( $wp_customize, 'bpq_opt_auxiliary_login_force_redirect',
array(
'label' => __( 'Login Redirect', 'bpq' ),
'desc' => __( 'If checked, Administrators are forced to the Admin; all others are forced home.', 'bpq' ),
'section' => 'bpq_cz_section_auxiliary',
'priority' => 12400
)));
}
/**
* Contains a number of functions that work on variable settings.
* @since 1.0
*/
class settings
{
/* PUBLIC */
/**
* Retrieves the selected sidebars layout with respect to the selection
* in the customizer (site-wide) and the potential page override.
* @return string A value like '0', 'l1', 'l2', 'l1r1', 'r1', or 'r2'
*/
public static function format_sidebars()
{
if ( \ski\post::get_opt( 'bpq_popt_sidebars_override', null ) == 'on' )
{
return \ski\post::get_opt( 'bpq_popt_sidebars_layout', 'r1' );
}
return get_theme_mod( 'bpq_opt_format_sidebar_layout', 'r1' );
}
/**
* Retrieves the selected site span with respect to the selection
* in the customizer (site-wide) and the potential page override.
* @return string A value like 'bleed-wide', 'bleed-narrow', or 'boxed-narrow'
*/
public static function format_span()
{
if ( \ski\post::get_opt( 'bpq_popt_span_override', null ) == 'on' )
{
return \ski\post::get_opt( 'bpq_popt_span', 'boxed-narrow' );
}
return get_theme_mod( 'bpq_opt_format_site_span', 'boxed-narrow' );
}
/**
* Retrieves the slug of the sidebar to use on the leftmost
* side with respect to the potential page override.
* @return string If set, the override; otherwise 'sidebar-1'
*/
public static function sidebars_1()
{
$override = \ski\post::get_opt( 'bpq_popt_sidebars_1', null );
if ( !empty( $override ) )
{
return $override;
}
return 'sidebar-1';
}
/**
* Retrieves the slug of the sidebar to use on the leftmost
* side with respect to the potential page override.
* @return string If set, the override; otherwise 'sidebar-2'
*/
public static function sidebars_2()
{
$override = \ski\post::get_opt( 'bpq_popt_sidebars_2', null );
if ( !empty( $override ) )
{
return $override;
}
return 'sidebar-2';
}
/* PRIVATE */
/**
* Only use this class as a utility.
*/
private function __construct()
{
// Intentionally blank..
}
}
?>