get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->add_panel( 'portage', array(
'title' => __( 'Portage Theme Options', 'portage' ),
'description' => __( 'The Portage theme has many options. Vist the theme\'s home page for complete instructions.', 'portage' ),
'priority' => 05,
) );
// Widget Areas
$wp_customize->add_section( 'portage_widget_areas', array(
'title' => __( 'Widget Areas', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 30,
'description' => __( 'Select which action hook widget areas you would like to activate.', 'portage' ),
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_before_header', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_header', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Header', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_top_menu', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_top_menu', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Top Menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_social_media', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_social_media', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Social Media', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_primary_menu', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_primary_menu', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Primary Menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_header', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_header', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Header', 'portage' ),
) );
$wp_customize->add_setting( 'portage_container_top', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_container_top', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Top of Container', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_post_title', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_post_title', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Post Title', 'portage' ),
) );
/*
* We've removed this action hook, but let's leave this control in place
* in case we find a use for it later.
$wp_customize->add_setting( 'portage_before_post_content', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_post_content', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Post Content', 'portage' ),
) );
*/
$wp_customize->add_setting( 'portage_post_top', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_post_top', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Top of Post', 'portage' ),
) );
$wp_customize->add_setting( 'portage_post_bottom', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_post_bottom', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Bottom of Post', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_post_content', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_post_content', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Post Content', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_post_meta', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_post_meta', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Post Meta', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_post_meta', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_post_meta', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Post Meta', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_comments', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_comments', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Comments', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_comments', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_comments', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Comments', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_comment_form', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_comment_form', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Comment Form', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_comment_form', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_comment_form', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Comment Form', 'portage' ),
) );
$wp_customize->add_setting( 'portage_container_bottom', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_container_bottom', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Bottom of Container', 'portage' ),
) );
$wp_customize->add_setting( 'portage_before_footer_menu', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_before_footer_menu', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Before Footer Menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_footer_top', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_footer_top', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Top of Footer', 'portage' ),
) );
$wp_customize->add_setting( 'portage_footer_bottom', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_footer_bottom', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'Bottom of Footer', 'portage' ),
) );
$wp_customize->add_setting( 'portage_after_footer', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_after_footer', array(
'section' => 'portage_widget_areas',
'type' => 'checkbox',
'label' => __( 'After Footer', 'portage' ),
) );
// Post Format Title Options
$wp_customize->add_section( 'portage_post_format_title_options', array(
'title' => __( 'Post Format Title Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 10,
'description' => __('Select whether titles should appear for various post formats.', 'portage'),
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_aside_title', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_aside_title', array(
'section' => 'portage_post_format_title_options',
'type' => 'checkbox',
'label' => __( 'Display title for asides', 'portage' ),
) );
$wp_customize->add_setting( 'portage_link_title', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_link_title', array(
'section' => 'portage_post_format_title_options',
'type' => 'checkbox',
'label' => __( 'Display title for links', 'portage' ),
) );
$wp_customize->add_setting( 'portage_quote_title', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_quote_title', array(
'section' => 'portage_post_format_title_options',
'type' => 'checkbox',
'label' => __( 'Display title for quotes', 'portage' ),
) );
$wp_customize->add_setting( 'portage_status_title', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_status_title', array(
'section' => 'portage_post_format_title_options',
'type' => 'checkbox',
'label' => __( 'Display title for statuses', 'portage' ),
) );
// Post Format Excerpt Options
$wp_customize->add_section( 'portage_post_format_excerpt_options', array(
'title' => __( 'Post Format Excerpt Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 20,
'description' => __('By default, the aside, link, quote, and statu post format will display full content on the home page. You can choose to show excerpts instead.', 'portage'),
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_aside_excerpt', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_aside_excerpt', array(
'section' => 'portage_post_format_excerpt_options',
'type' => 'checkbox',
'label' => __( 'Display excerpt for asides', 'portage' ),
) );
$wp_customize->add_setting( 'portage_link_excerpt', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_link_excerpt', array(
'section' => 'portage_post_format_excerpt_options',
'type' => 'checkbox',
'label' => __( 'Display excerpt for links', 'portage' ),
) );
$wp_customize->add_setting( 'portage_quote_excerpt', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_quote_excerpt', array(
'section' => 'portage_post_format_excerpt_options',
'type' => 'checkbox',
'label' => __( 'Display excerpt for quotes', 'portage' ),
) );
$wp_customize->add_setting( 'portage_status_excerpt', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_status_excerpt', array(
'section' => 'portage_post_format_excerpt_options',
'type' => 'checkbox',
'label' => __( 'Display excerpt for statuses', 'portage' ),
) );
$default_readmore = __( '…read more…', 'portage' );
$wp_customize->add_setting( 'portage_readmore', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => $default_readmore,
'sanitize_callback' => 'portage_sanitize_text',
) );
$wp_customize->add_control( 'portage_readmore', array(
'section' => 'portage_post_format_excerpt_options',
'type' => 'text',
'label' => __( 'Text for ‘read more’ link (in all excerpts)', 'portage'),
) );
// Copyright Information
$wp_customize->add_section( 'portage_copyright', array(
'title' => __( 'Copyright Information', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 50,
'description' => __( 'Copyright information will appear in the footer, and at the bottom of printed pages. (Make sure you have not disabled this function under "Miscellaneous Options")', 'portage' ),
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_copyright', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'html',
) );
$default_copyright = 'This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.';
$wp_customize->add_control( 'portage_copyright', array(
'section' => 'portage_copyright',
'default' => $default_copyright,
'type' => 'textarea',
'label' => __( 'Enter your copyright information. (HTML is allowed.)', 'portage' ),
) );
// Print Options
$wp_customize->add_section( 'portage_print', array (
'title' => __( 'Print Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 40,
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_print_url', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_print_url', array(
'section' => 'portage_print',
'type' => 'checkbox',
'label' => __( 'Print URL information at end of post', 'portage' ),
) );
$wp_customize->add_setting( 'portage_print_copyright', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_print_copyright', array(
'section' => 'portage_print',
'type' => 'checkbox',
'label' => __( 'Print copyright information at end of post', 'portage' ),
) );
// Social Media Options
$wp_customize->add_section( 'portage_social_media', array(
'title' => __( 'Social Media Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 90,
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_rss', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_rss', array(
'section' => 'portage_social_media',
'type' => 'checkbox',
'label' => __( 'Display link to RSS feed', 'portage' ),
) );
$wp_customize->add_setting( 'portage_twitter', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_twitter', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter Twitter URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_twitter2', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_twitter2', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter second Twitter URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_facebook', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_facebook', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter Facebook URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_instagram', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_instagram', array(
'section' => 'portage_social_media',
'type' => 'text',
'label' => __( 'Enter Instagram URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_youtube', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_youtube', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter YouTube URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_pinterest', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_pinterest', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter Pinterest Profile URL', 'portage'),
) );
$wp_customize->add_setting( 'portage_amazon', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_url',
) );
$wp_customize->add_control( 'portage_amazon', array(
'section' => 'portage_social_media',
'type' => 'url',
'label' => __( 'Enter Amazon Wish List URL', 'portage'),
) );
// Mobile Menu Options
$wp_customize->add_section( 'portage_mobile_menu_options', array(
'title' => __( 'Mobile Menu Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 110,
'description' => __('Menu settings for mobile appearance. Note: The breakpoint settings will override the "mobile breakpoint" setting.', 'portage'),
'panel' => 'portage',
) );
// Top Menu Options
$wp_customize->add_setting( 'portage_top_menu_name', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_text',
) );
$wp_customize->add_control( 'portage_top_menu_name', array(
'section' => 'portage_mobile_menu_options',
'type' => 'text',
'label' => __( 'Mobile display name for top menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_top_menu_type', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_mobile_menu_type',
'default' => 'select',
) );
$wp_customize->add_control( 'portage_top_menu_type', array(
'section' => 'portage_mobile_menu_options',
'type' => 'select',
'choices' => array(
'select' => 'Select Menu',
'dropdown' => 'Flat Menu',
'multitoggle' => 'Dropdown Menu',
),
'label' => __( 'Display the top menu as', 'portage' ),
) );
$wp_customize->add_setting( 'portage_top_menu_breakpoint', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_int',
'default' => 640,
) );
$wp_customize->add_control( 'portage_top_menu_breakpoint', array(
'section' => 'portage_mobile_menu_options',
'type' => 'integer',
'label' => __( 'Breakpoint to display top menu as mobile', 'portage' ),
) );
// Main Menu Options
$wp_customize->add_setting( 'portage_main_menu_name', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_text',
) );
$wp_customize->add_control( 'portage_main_menu_name', array(
'section' => 'portage_mobile_menu_options',
'type' => 'text',
'label' => __( 'Mobile display name for main menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_main_menu_type', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_mobile_menu_type',
'default' => 'select',
) );
$wp_customize->add_control( 'portage_main_menu_type', array(
'section' => 'portage_mobile_menu_options',
'type' => 'select',
'choices' => array(
'select' => 'Select Menu',
'dropdown' => 'Flat Menu',
'multitoggle' => 'Dropdown Menu',
),
'label' => __( 'Display the menu menu as', 'portage' ),
) );
$wp_customize->add_setting( 'portage_main_menu_breakpoint', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_int',
'default' => 640,
) );
$wp_customize->add_control( 'portage_main_menu_breakpoint', array(
'section' => 'portage_mobile_menu_options',
'type' => 'integer',
'label' => __( 'Breakpoint to display main menu as mobile', 'portage' ),
) );
// Footer Menu Options
$wp_customize->add_setting( 'portage_footer_menu_name', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_text',
) );
$wp_customize->add_control( 'portage_footer_menu_name', array(
'section' => 'portage_mobile_menu_options',
'type' => 'text',
'label' => __( 'Mobile display name for footer menu', 'portage' ),
) );
$wp_customize->add_setting( 'portage_footer_menu_type', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_mobile_menu_type',
'default' => 'select',
) );
$wp_customize->add_control( 'portage_footer_menu_type', array(
'section' => 'portage_mobile_menu_options',
'type' => 'select',
'choices' => array(
'select' => 'Select Menu',
'dropdown' => 'Flat Menu',
'multitoggle' => 'Dropdown Menu',
),
'label' => __( 'Display the footer menu as', 'portage' ),
) );
$wp_customize->add_setting( 'portage_footer_menu_breakpoint', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => 'portage_sanitize_int',
'default' => 640,
) );
$wp_customize->add_control( 'portage_footer_menu_breakpoint', array(
'section' => 'portage_mobile_menu_options',
'type' => 'integer',
'label' => __( 'Breakpoint to display footer menu as mobile', 'portage' ),
) );
// Mobile Options Options
$wp_customize->add_section( 'portage_mobile', array(
'title' => __( 'Mobile Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 100,
'panel' => 'portage',
'description' => 'Fine-tune your mobile appearance',
) );
$wp_customize->add_setting( 'portage_mobile_breakpoint', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '640',
'sanitize_callback' => 'portage_sanitize_int',
) );
$wp_customize->add_control( 'portage_mobile_breakpoint', array(
'section' => 'portage_mobile',
'type' => 'text',
'label' => __( 'Breakpoint to display mobile version of theme', 'portage' ),
) );
$wp_customize->add_setting( 'portage_post_top_link', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '0',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_post_top_link', array(
'section' => 'portage_mobile',
'type' => 'checkbox',
'label' => __( 'Display \'Return to Top\' link after post content', 'portage' ),
) );
$wp_customize->add_setting( 'portage_footer_top_link', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '0',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_footer_top_link', array(
'section' => 'portage_mobile',
'type' => 'checkbox',
'label' => __( 'Display \'Return to Top\' link before footer content', 'portage' ),
) );
// Miscellaneous Options
$wp_customize->add_section( 'portage_misc', array(
'title' => __( 'Miscellaneous Options', 'portage' ),
'capability' => 'edit_theme_options',
'priority' => 200,
'panel' => 'portage',
) );
$wp_customize->add_setting( 'portage_display_copyright', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '1',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_display_copyright', array(
'section' => 'portage_misc',
'type' => 'checkbox',
'label' => __( 'Display copyright information in footer', 'portage' ),
) );
$wp_customize->add_setting( 'portage_display_credits', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '1',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_display_credits', array(
'section' => 'portage_misc',
'type' => 'checkbox',
'label' => __( 'Display developer credits in footer', 'portage' ),
) );
$wp_customize->add_setting( 'portage_edit_post_link', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '1',
'sanitize_callback' => 'portage_sanitize_checkbox',
) );
$wp_customize->add_control( 'portage_edit_post_link', array(
'section' => 'portage_misc',
'type' => 'checkbox',
'label' => __( 'Display "Edit this post" link if user is logged in', 'portage' ),
) );
$wp_customize->add_setting( 'portage_excerpt_length', array(
'type' => 'theme_mod',
'transport' => 'postMessage',
'default' => '20',
'sanitize_callback' => 'portage_sanitize_excerpt',
) );
$wp_customize->add_control( 'portage_excerpt_length', array(
'section' => 'portage_misc',
'type' => 'text',
'label' => __( 'Excerpt length in number of words (maximum = 100)', 'portage' ),
) );
// Preview some of our options
/*
if ( $wp_customize->is_preview() && ! is_admin() )
add_action( 'wp_footer', 'portage_customize_preview', 21);
function themename_customize_preview() {
?>
100 ) { $input = 100; }
return $input;
}
function portage_sanitize_html( $input ) {
wp_kses($input,
array(),
array(
'http' => array(),
'https' => array(),
)
);
}
function portage_sanitize_url( $url ) {
return esc_url_raw( $url );
}
function portage_sanitize_mobile_menu_type( $input ){
$valid = array(
'select' => 'Select Menu',
'dropdown' => 'Flat Menu',
'multitoggle' => 'Dropdown Menu',
);
if ( array_key_exists( $input, $valid ) ) {
return $input;
} else {
return '';
}
}
function portage_sanitize_int( $input ){
if( is_numeric( $input) ) {
return intval( $input );
}
}