defaults = skyrocket_generate_defaults(); // Register our Panels add_action( 'customize_register', array( $this, 'skyrocket_add_customizer_panels' ) ); // Register our sections add_action( 'customize_register', array( $this, 'skyrocket_add_customizer_sections' ) ); // Register our social media controls add_action( 'customize_register', array( $this, 'skyrocket_register_social_controls' ) ); // Register our contact controls add_action( 'customize_register', array( $this, 'skyrocket_register_contact_controls' ) ); // Register our search controls add_action( 'customize_register', array( $this, 'skyrocket_register_search_controls' ) ); // Register our WooCommerce controls, only if WooCommerce is active /*if( skyrocket_is_woocommerce_active() ) { add_action( 'customize_register', array( $this, 'skyrocket_register_woocommerce_controls' ) ); }*/ // Register our sample Custom Control controls add_action( 'customize_register', array( $this, 'skyrocket_register_sample_custom_controls' ) ); // Register our sample default controls add_action( 'customize_register', array( $this, 'skyrocket_register_sample_default_controls' ) ); } /** * Register the Customizer panels */ public function skyrocket_add_customizer_panels( $wp_customize ) { /** * Add our Header & Navigation Panel */ $wp_customize->add_panel( 'header_naviation_panel', array( 'title' => __( 'Header & Navigation', 'pageflow-2k21' ), 'description' => esc_html__( 'Adjust your Header and Navigation sections.', 'pageflow-2k21' ) ) ); } /** * Register the Customizer sections */ public function skyrocket_add_customizer_sections( $wp_customize ) { /** * Add our Social Icons Section */ $wp_customize->add_section( 'social_icons_section', array( 'title' => __( 'Social Icons', 'pageflow-2k21' ), 'description' => esc_html__( 'Add your social media links and we\'ll automatically match them with the appropriate icons. Drag and drop the URLs to rearrange their order.', 'pageflow-2k21' ), 'panel' => 'header_naviation_panel' ) ); /** * Add our Contact Section */ $wp_customize->add_section( 'contact_section', array( 'title' => __( 'Contact', 'pageflow-2k21' ), 'description' => esc_html__( 'Add your phone number to the site header bar.', 'pageflow-2k21' ), 'panel' => 'header_naviation_panel' ) ); /** * Add our Search Section */ $wp_customize->add_section( 'search_section', array( 'title' => __( 'Search', 'pageflow-2k21' ), 'description' => esc_html__( 'Add a search icon to your primary naigation menu.', 'pageflow-2k21' ), 'panel' => 'header_naviation_panel' ) ); /** * Add our WooCommerce Layout Section, only if WooCommerce is active */ $wp_customize->add_section( 'woocommerce_layout_section', array( 'title' => __( 'WooCommerce Layout', 'pageflow-2k21' ), 'description' => esc_html__( 'Adjust the layout of your WooCommerce shop.', 'pageflow-2k21' ), 'active_callback' => 'skyrocket_is_woocommerce_active' ) ); /** * Add our section that contains examples of our Custom Controls */ $wp_customize->add_section( 'sample_custom_controls_section', array( 'title' => __( 'Sample Custom Controls', 'pageflow-2k21' ), 'description' => esc_html__( 'These are an example of Customizer Custom Controls.', 'pageflow-2k21' ) ) ); /** * Add our section that contains examples of the default Core Customizer Controls */ $wp_customize->add_section( 'default_controls_section', array( 'title' => __( 'Default Controls', 'pageflow-2k21' ), 'description' => esc_html__( 'These are an example of the default Customizer Controls.', 'pageflow-2k21' ) ) ); /** * Add our Upsell Section */ $wp_customize->add_section( new Skyrocket_Upsell_Section( $wp_customize, 'upsell_section', array( 'title' => __( 'Premium Addons Available', 'pageflow-2k21' ), 'url' => 'https://skyrocketthemes.com', 'backgroundcolor' => '#344860', 'textcolor' => '#fff', 'priority' => 0, ) ) ); } /** * Register our social media controls */ public function skyrocket_register_social_controls( $wp_customize ) { // Add our Checkbox switch setting and control for opening URLs in a new tab $wp_customize->add_setting( 'social_newtab', array( 'default' => $this->defaults['social_newtab'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'social_newtab', array( 'label' => __( 'Open in new browser tab', 'pageflow-2k21' ), 'section' => 'social_icons_section' ) ) ); $wp_customize->selective_refresh->add_partial( 'social_newtab', array( 'selector' => '.social', 'container_inclusive' => false, 'render_callback' => function() { echo skyrocket_get_social_media(); }, 'fallback_refresh' => true ) ); // Add our Text Radio Button setting and Custom Control for controlling alignment of icons $wp_customize->add_setting( 'social_alignment', array( 'default' => $this->defaults['social_alignment'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_radio_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Text_Radio_Button_Custom_Control( $wp_customize, 'social_alignment', array( 'label' => __( 'Alignment', 'pageflow-2k21' ), 'description' => esc_html__( 'Choose the alignment for your social icons', 'pageflow-2k21' ), 'section' => 'social_icons_section', 'choices' => array( 'alignleft' => __( 'Left', 'pageflow-2k21' ), 'alignright' => __( 'Right', 'pageflow-2k21' ) ) ) ) ); $wp_customize->selective_refresh->add_partial( 'social_alignment', array( 'selector' => '.social', 'container_inclusive' => false, 'render_callback' => function() { echo skyrocket_get_social_media(); }, 'fallback_refresh' => true ) ); // Add our Sortable Repeater setting and Custom Control for Social media URLs $wp_customize->add_setting( 'social_urls', array( 'default' => $this->defaults['social_urls'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_url_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Sortable_Repeater_Custom_Control( $wp_customize, 'social_urls', array( 'label' => __( 'Social URLs', 'pageflow-2k21' ), 'description' => esc_html__( 'Add your social media links.', 'pageflow-2k21' ), 'section' => 'social_icons_section', 'button_labels' => array( 'add' => __( 'Add Icon', 'pageflow-2k21' ), ) ) ) ); $wp_customize->selective_refresh->add_partial( 'social_urls', array( 'selector' => '.social', 'container_inclusive' => false, 'render_callback' => function() { echo skyrocket_get_social_media(); }, 'fallback_refresh' => true ) ); // Add our Single Accordion setting and Custom Control to list the available Social Media icons $socialIconsList = array( 'Behance' => __( '', 'pageflow-2k21' ), 'Bitbucket' => __( '', 'pageflow-2k21' ), 'CodePen' => __( '', 'pageflow-2k21' ), 'DeviantArt' => __( '', 'pageflow-2k21' ), 'Discord' => __( '', 'pageflow-2k21' ), 'Dribbble' => __( '', 'pageflow-2k21' ), 'Etsy' => __( '', 'pageflow-2k21' ), 'Facebook' => __( '', 'pageflow-2k21' ), 'Flickr' => __( '', 'pageflow-2k21' ), 'Foursquare' => __( '', 'pageflow-2k21' ), 'GitHub' => __( '', 'pageflow-2k21' ), 'Google+' => __( '', 'pageflow-2k21' ), 'Instagram' => __( '', 'pageflow-2k21' ), 'Kickstarter' => __( '', 'pageflow-2k21' ), 'Last.fm' => __( '', 'pageflow-2k21' ), 'LinkedIn' => __( '', 'pageflow-2k21' ), 'Medium' => __( '', 'pageflow-2k21' ), 'Patreon' => __( '', 'pageflow-2k21' ), 'Pinterest' => __( '', 'pageflow-2k21' ), 'Reddit' => __( '', 'pageflow-2k21' ), 'Slack' => __( '', 'pageflow-2k21' ), 'SlideShare' => __( '', 'pageflow-2k21' ), 'Snapchat' => __( '', 'pageflow-2k21' ), 'SoundCloud' => __( '', 'pageflow-2k21' ), 'Spotify' => __( '', 'pageflow-2k21' ), 'Stack Overflow' => __( '', 'pageflow-2k21' ), 'Tumblr' => __( '', 'pageflow-2k21' ), 'Twitch' => __( '', 'pageflow-2k21' ), 'Twitter' => __( '', 'pageflow-2k21' ), 'Vimeo' => __( '', 'pageflow-2k21' ), 'Weibo' => __( '', 'pageflow-2k21' ), 'YouTube' => __( '', 'pageflow-2k21' ), ); $wp_customize->add_setting( 'social_url_icons', array( 'default' => $this->defaults['social_url_icons'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Single_Accordion_Custom_Control( $wp_customize, 'social_url_icons', array( 'label' => __( 'View list of available icons', 'pageflow-2k21' ), 'description' => $socialIconsList, 'section' => 'social_icons_section' ) ) ); // Add our Checkbox switch setting and Custom Control for displaying an RSS icon $wp_customize->add_setting( 'social_rss', array( 'default' => $this->defaults['social_rss'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'social_rss', array( 'label' => __( 'Display RSS icon', 'pageflow-2k21' ), 'section' => 'social_icons_section' ) ) ); $wp_customize->selective_refresh->add_partial( 'social_rss', array( 'selector' => '.social', 'container_inclusive' => false, 'render_callback' => function() { echo skyrocket_get_social_media(); }, 'fallback_refresh' => true ) ); } /** * Register our Contact controls */ public function skyrocket_register_contact_controls( $wp_customize ) { // Add our Text field setting and Control for displaying the phone number $wp_customize->add_setting( 'contact_phone', array( 'default' => $this->defaults['contact_phone'], 'transport' => 'postMessage', 'sanitize_callback' => 'wp_filter_nohtml_kses' ) ); $wp_customize->add_control( 'contact_phone', array( 'label' => __( 'Display phone number', 'pageflow-2k21' ), 'type' => 'text', 'section' => 'contact_section' ) ); $wp_customize->selective_refresh->add_partial( 'contact_phone', array( 'selector' => '.social', 'container_inclusive' => false, 'render_callback' => function() { echo skyrocket_get_social_media(); }, 'fallback_refresh' => true ) ); } /** * Register our Search controls */ public function skyrocket_register_search_controls( $wp_customize ) { // Add our Checkbox switch setting and control for opening URLs in a new tab $wp_customize->add_setting( 'search_menu_icon', array( 'default' => $this->defaults['search_menu_icon'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'search_menu_icon', array( 'label' => __( 'Display Search Icon', 'pageflow-2k21' ), 'section' => 'search_section' ) ) ); $wp_customize->selective_refresh->add_partial( 'search_menu_icon', array( 'selector' => '.menu-item-search', 'container_inclusive' => false, 'fallback_refresh' => false ) ); } /** * Register our WooCommerce Layout controls */ public function skyrocket_register_woocommerce_controls( $wp_customize ) { // Add our Checkbox switch setting and control for displaying a sidebar on the shop page $wp_customize->add_setting( 'woocommerce_shop_sidebar', array( 'default' => $this->defaults['woocommerce_shop_sidebar'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'woocommerce_shop_sidebar', array( 'label' => __( 'Shop page sidebar', 'pageflow-2k21' ), 'section' => 'woocommerce_layout_section' ) ) ); // Add our Checkbox switch setting and control for displaying a sidebar on the single product page $wp_customize->add_setting( 'woocommerce_product_sidebar', array( 'default' => $this->defaults['woocommerce_product_sidebar'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'woocommerce_product_sidebar', array( 'label' => esc_html__( 'Single Product page sidebar', 'pageflow-2k21' ), 'section' => 'woocommerce_layout_section' ) ) ); // Add our Simple Notice setting and control for displaying a message about the WooCommerce shop sidebars $wp_customize->add_setting( 'woocommerce_other_sidebar', array( 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Simple_Notice_Custom_control( $wp_customize, 'woocommerce_other_sidebar', array( 'label' => __( 'Cart, Checkout & My Account sidebars', 'pageflow-2k21' ), 'description' => esc_html__( 'The Cart, Checkout and My Account pages are displayed using shortcodes. To remove the sidebar from these Pages, simply edit each Page and change the Template (in the Page Attributes Panel) to Full-width Page.', 'pageflow-2k21' ), 'section' => 'woocommerce_layout_section' ) ) ); } /** * Register our sample custom controls */ public function skyrocket_register_sample_custom_controls( $wp_customize ) { // Test of Toggle Switch Custom Control $wp_customize->add_setting( 'sample_toggle_switch', array( 'default' => $this->defaults['sample_toggle_switch'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'sample_toggle_switch', array( 'label' => __( 'Toggle switch', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section' ) ) ); // Test of Slider Custom Control $wp_customize->add_setting( 'sample_slider_control', array( 'default' => $this->defaults['sample_slider_control'], 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new Skyrocket_Slider_Custom_Control( $wp_customize, 'sample_slider_control', array( 'label' => __( 'Slider Control (px)', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'min' => 10, 'max' => 90, 'step' => 1, ), ) ) ); // Another Test of Slider Custom Control $wp_customize->add_setting( 'sample_slider_control_small_step', array( 'default' => $this->defaults['sample_slider_control_small_step'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_range_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Slider_Custom_Control( $wp_customize, 'sample_slider_control_small_step', array( 'label' => __( 'Slider Control With a Small Step', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'min' => 0, 'max' => 4, 'step' => .5, ), ) ) ); // Add our Sortable Repeater setting and Custom Control for Social media URLs $wp_customize->add_setting( 'sample_sortable_repeater_control', array( 'default' => $this->defaults['sample_sortable_repeater_control'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_url_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Sortable_Repeater_Custom_Control( $wp_customize, 'sample_sortable_repeater_control', array( 'label' => __( 'Sortable Repeater', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the control description.', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'button_labels' => array( 'add' => __( 'Add Row', 'pageflow-2k21' ), ) ) ) ); // Test of Image Radio Button Custom Control $wp_customize->add_setting( 'sample_image_radio_button', array( 'default' => $this->defaults['sample_image_radio_button'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_radio_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Image_Radio_Button_Custom_Control( $wp_customize, 'sample_image_radio_button', array( 'label' => __( 'Image Radio Button Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample custom control description', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'choices' => array( 'sidebarleft' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/sidebar-left.png', 'name' => __( 'Left Sidebar', 'pageflow-2k21' ) ), 'sidebarnone' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/sidebar-none.png', 'name' => __( 'No Sidebar', 'pageflow-2k21' ) ), 'sidebarright' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/sidebar-right.png', 'name' => __( 'Right Sidebar', 'pageflow-2k21' ) ) ) ) ) ); // Test of Text Radio Button Custom Control $wp_customize->add_setting( 'sample_text_radio_button', array( 'default' => $this->defaults['sample_text_radio_button'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_radio_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Text_Radio_Button_Custom_Control( $wp_customize, 'sample_text_radio_button', array( 'label' => __( 'Text Radio Button Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample custom control description', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'choices' => array( 'left' => __( 'Left', 'pageflow-2k21' ), 'centered' => __( 'Centered', 'pageflow-2k21' ), 'right' => __( 'Right', 'pageflow-2k21' ) ) ) ) ); // Test of Image Checkbox Custom Control $wp_customize->add_setting( 'sample_image_checkbox', array( 'default' => $this->defaults['sample_image_checkbox'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Image_checkbox_Custom_Control( $wp_customize, 'sample_image_checkbox', array( 'label' => __( 'Image Checkbox Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample custom control description', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'choices' => array( 'stylebold' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/Bold.png', 'name' => __( 'Bold', 'pageflow-2k21' ) ), 'styleitalic' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/Italic.png', 'name' => __( 'Italic', 'pageflow-2k21' ) ), 'styleallcaps' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/AllCaps.png', 'name' => __( 'All Caps', 'pageflow-2k21' ) ), 'styleunderline' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'images/Underline.png', 'name' => __( 'Underline', 'pageflow-2k21' ) ) ) ) ) ); // Test of Single Accordion Control $sampleIconsList = array( 'Behance' => __( '', 'pageflow-2k21' ), 'Bitbucket' => __( '', 'pageflow-2k21' ), 'CodePen' => __( '', 'pageflow-2k21' ), 'DeviantArt' => __( '', 'pageflow-2k21' ), 'Discord' => __( '', 'pageflow-2k21' ), 'Dribbble' => __( '', 'pageflow-2k21' ), 'Etsy' => __( '', 'pageflow-2k21' ), 'Facebook' => __( '', 'pageflow-2k21' ), 'Flickr' => __( '', 'pageflow-2k21' ), 'Foursquare' => __( '', 'pageflow-2k21' ), 'GitHub' => __( '', 'pageflow-2k21' ), 'Google+' => __( '', 'pageflow-2k21' ), 'Instagram' => __( '', 'pageflow-2k21' ), 'Kickstarter' => __( '', 'pageflow-2k21' ), 'Last.fm' => __( '', 'pageflow-2k21' ), 'LinkedIn' => __( '', 'pageflow-2k21' ), 'Medium' => __( '', 'pageflow-2k21' ), 'Patreon' => __( '', 'pageflow-2k21' ), 'Pinterest' => __( '', 'pageflow-2k21' ), 'Reddit' => __( '', 'pageflow-2k21' ), 'Slack' => __( '', 'pageflow-2k21' ), 'SlideShare' => __( '', 'pageflow-2k21' ), 'Snapchat' => __( '', 'pageflow-2k21' ), 'SoundCloud' => __( '', 'pageflow-2k21' ), 'Spotify' => __( '', 'pageflow-2k21' ), 'Stack Overflow' => __( '', 'pageflow-2k21' ), 'Tumblr' => __( '', 'pageflow-2k21' ), 'Twitch' => __( '', 'pageflow-2k21' ), 'Twitter' => __( '', 'pageflow-2k21' ), 'Vimeo' => __( '', 'pageflow-2k21' ), 'Weibo' => __( '', 'pageflow-2k21' ), 'YouTube' => __( '', 'pageflow-2k21' ), ); $wp_customize->add_setting( 'sample_single_accordion', array( 'default' => $this->defaults['sample_single_accordion'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Single_Accordion_Custom_Control( $wp_customize, 'sample_single_accordion', array( 'label' => __( 'Single Accordion Control', 'pageflow-2k21' ), 'description' => $sampleIconsList, 'section' => 'sample_custom_controls_section' ) ) ); // Test of Alpha Color Picker Control $wp_customize->add_setting( 'sample_alpha_color', array( 'default' => $this->defaults['sample_alpha_color'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_hex_rgba_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'sample_alpha_color', array( 'label' => __( 'Alpha Color Picker Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample custom control description', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'show_opacity' => true, 'palette' => array( '#000', '#fff', '#df312c', '#df9a23', '#eef000', '#7ed934', '#1571c1', '#8309e7' ) ) ) ); // Test of WPColorPicker Alpha Color Picker Control $wp_customize->add_setting( 'sample_wpcolorpicker_alpha_color', array( 'default' => $this->defaults['sample_wpcolorpicker_alpha_color'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_hex_rgba_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Alpha_Color_Control( $wp_customize, 'sample_wpcolorpicker_alpha_color', array( 'label' => __( 'WP ColorPicker Alpha Color Picker', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample color control with Alpha channel', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'palette' => array( '#000000', '#222222', '#444444', '#777777', '#999999', '#aaaaaa', '#dddddd', '#ffffff', ) ), ) ) ); // Another Test of WPColorPicker Alpha Color Picker Control $wp_customize->add_setting( 'sample_wpcolorpicker_alpha_color2', array( 'default' => $this->defaults['sample_wpcolorpicker_alpha_color2'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_hex_rgba_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Alpha_Color_Control( $wp_customize, 'sample_wpcolorpicker_alpha_color2', array( 'label' => __( 'WP ColorPicker Alpha Color Picker', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample color control with Alpha channel', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'resetalpha' => false, 'palette' => array( 'rgba(99,78,150,1)', 'rgba(67,78,150,1)', 'rgba(34,78,150,.7)', 'rgba(3,78,150,1)', 'rgba(7,110,230,.9)', 'rgba(234,78,150,1)', 'rgba(99,78,150,.5)', 'rgba(190,120,120,.5)', ), ), ) ) ); // Test of Pill Checkbox Custom Control $wp_customize->add_setting( 'sample_pill_checkbox', array( 'default' => $this->defaults['sample_pill_checkbox'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Pill_Checkbox_Custom_Control( $wp_customize, 'sample_pill_checkbox', array( 'label' => __( 'Pill Checkbox Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is a sample Pill Checkbox Control', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'sortable' => false, 'fullwidth' => false, ), 'choices' => array( 'tiger' => __( 'Tiger', 'pageflow-2k21' ), 'lion' => __( 'Lion', 'pageflow-2k21' ), 'giraffe' => __( 'Giraffe', 'pageflow-2k21' ), 'elephant' => __( 'Elephant', 'pageflow-2k21' ), 'hippo' => __( 'Hippo', 'pageflow-2k21' ), 'rhino' => __( 'Rhino', 'pageflow-2k21' ), ) ) ) ); // Test of Pill Checkbox Custom Control $wp_customize->add_setting( 'sample_pill_checkbox2', array( 'default' => $this->defaults['sample_pill_checkbox2'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Pill_Checkbox_Custom_Control( $wp_customize, 'sample_pill_checkbox2', array( 'label' => __( 'Pill Checkbox Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is a sample Sortable Pill Checkbox Control', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'sortable' => true, 'fullwidth' => false, ), 'choices' => array( 'captainamerica' => __( 'Captain America', 'pageflow-2k21' ), 'ironman' => __( 'Iron Man', 'pageflow-2k21' ), 'captainmarvel' => __( 'Captain Marvel', 'pageflow-2k21' ), 'msmarvel' => __( 'Ms. Marvel', 'pageflow-2k21' ), 'Jessicajones' => __( 'Jessica Jones', 'pageflow-2k21' ), 'squirrelgirl' => __( 'Squirrel Girl', 'pageflow-2k21' ), 'blackwidow' => __( 'Black Widow', 'pageflow-2k21' ), 'hulk' => __( 'Hulk', 'pageflow-2k21' ), ) ) ) ); // Test of Pill Checkbox Custom Control $wp_customize->add_setting( 'sample_pill_checkbox3', array( 'default' => $this->defaults['sample_pill_checkbox3'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Pill_Checkbox_Custom_Control( $wp_customize, 'sample_pill_checkbox3', array( 'label' => __( 'Pill Checkbox Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is a sample Sortable Fullwidth Pill Checkbox Control', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'sortable' => true, 'fullwidth' => true, ), 'choices' => array( 'date' => __( 'Date', 'pageflow-2k21' ), 'author' => __( 'Author', 'pageflow-2k21' ), 'categories' => __( 'Categories', 'pageflow-2k21' ), 'tags' => __( 'Tags', 'pageflow-2k21' ), 'comments' => __( 'Comments', 'pageflow-2k21' ), ) ) ) ); // Test of Simple Notice control $wp_customize->add_setting( 'sample_simple_notice', array( 'default' => $this->defaults['sample_simple_notice'], 'transport' => 'postMessage', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Simple_Notice_Custom_control( $wp_customize, 'sample_simple_notice', array( 'label' => __( 'Simple Notice Control', 'pageflow-2k21' ), 'description' => __('This Custom Control allows you to display a simple title and description to your users.', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section' ) ) ); // Test of Dropdown Select2 Control (single select) $wp_customize->add_setting( 'sample_dropdown_select2_control_single', array( 'default' => $this->defaults['sample_dropdown_select2_control_single'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Dropdown_Select2_Custom_Control( $wp_customize, 'sample_dropdown_select2_control_single', array( 'label' => __( 'Dropdown Select2 Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample Dropdown Select2 custom control (Single Select)', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'placeholder' => __( 'Please select a state...', 'pageflow-2k21' ), 'multiselect' => false, ), 'choices' => array( 'nsw' => __( 'New South Wales', 'pageflow-2k21' ), 'vic' => __( 'Victoria', 'pageflow-2k21' ), 'qld' => __( 'Queensland', 'pageflow-2k21' ), 'wa' => __( 'Western Australia', 'pageflow-2k21' ), 'sa' => __( 'South Australia', 'pageflow-2k21' ), 'tas' => __( 'Tasmania', 'pageflow-2k21' ), 'act' => __( 'Australian Capital Territory', 'pageflow-2k21' ), 'nt' => __( 'Northern Territory', 'pageflow-2k21' ), ) ) ) ); // Test of Dropdown Select2 Control (Multi-Select) $wp_customize->add_setting( 'sample_dropdown_select2_control_multi', array( 'default' => $this->defaults['sample_dropdown_select2_control_multi'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Dropdown_Select2_Custom_Control( $wp_customize, 'sample_dropdown_select2_control_multi', array( 'label' => __( 'Dropdown Select2 Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample Dropdown Select2 custom control (Multi-Select)', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'multiselect' => true, ), 'choices' => array( __( 'Antarctica', 'pageflow-2k21' ) => array( 'Antarctica/Casey' => __( 'Casey', 'pageflow-2k21' ), 'Antarctica/Davis' => __( 'Davis', 'pageflow-2k21' ), 'Antarctica/DumontDurville' => __( 'DumontDUrville', 'pageflow-2k21' ), 'Antarctica/Macquarie' => __( 'Macquarie', 'pageflow-2k21' ), 'Antarctica/Mawson' => __( 'Mawson', 'pageflow-2k21' ), 'Antarctica/McMurdo' => __( 'McMurdo', 'pageflow-2k21' ), 'Antarctica/Palmer' => __( 'Palmer', 'pageflow-2k21' ), 'Antarctica/Rothera' => __( 'Rothera', 'pageflow-2k21' ), 'Antarctica/Syowa' => __( 'Syowa', 'pageflow-2k21' ), 'Antarctica/Troll' => __( 'Troll', 'pageflow-2k21' ), 'Antarctica/Vostok' => __( 'Vostok', 'pageflow-2k21' ), ), __( 'Atlantic', 'pageflow-2k21' ) => array( 'Atlantic/Azores' => __( 'Azores', 'pageflow-2k21' ), 'Atlantic/Bermuda' => __( 'Bermuda', 'pageflow-2k21' ), 'Atlantic/Canary' => __( 'Canary', 'pageflow-2k21' ), 'Atlantic/Cape_Verde' => __( 'Cape Verde', 'pageflow-2k21' ), 'Atlantic/Faroe' => __( 'Faroe', 'pageflow-2k21' ), 'Atlantic/Madeira' => __( 'Madeira', 'pageflow-2k21' ), 'Atlantic/Reykjavik' => __( 'Reykjavik', 'pageflow-2k21' ), 'Atlantic/South_Georgia' => __( 'South Georgia', 'pageflow-2k21' ), 'Atlantic/Stanley' => __( 'Stanley', 'pageflow-2k21' ), 'Atlantic/St_Helena' => __( 'St Helena', 'pageflow-2k21' ), ), __( 'Australia', 'pageflow-2k21' ) => array( 'Australia/Adelaide' => __( 'Adelaide', 'pageflow-2k21' ), 'Australia/Brisbane' => __( 'Brisbane', 'pageflow-2k21' ), 'Australia/Broken_Hill' => __( 'Broken Hill', 'pageflow-2k21' ), 'Australia/Currie' => __( 'Currie', 'pageflow-2k21' ), 'Australia/Darwin' => __( 'Darwin', 'pageflow-2k21' ), 'Australia/Eucla' => __( 'Eucla', 'pageflow-2k21' ), 'Australia/Hobart' => __( 'Hobart', 'pageflow-2k21' ), 'Australia/Lindeman' => __( 'Lindeman', 'pageflow-2k21' ), 'Australia/Lord_Howe' => __( 'Lord Howe', 'pageflow-2k21' ), 'Australia/Melbourne' => __( 'Melbourne', 'pageflow-2k21' ), 'Australia/Perth' => __( 'Perth', 'pageflow-2k21' ), 'Australia/Sydney' => __( 'Sydney', 'pageflow-2k21' ), ) ) ) ) ); // Test of Dropdown Select2 Control (Multi-Select) with single array choice $wp_customize->add_setting( 'sample_dropdown_select2_control_multi2', array( 'default' => $this->defaults['sample_dropdown_select2_control_multi2'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Dropdown_Select2_Custom_Control( $wp_customize, 'sample_dropdown_select2_control_multi2', array( 'label' => __( 'Dropdown Select2 Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Another Sample Dropdown Select2 custom control (Multi-Select)', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'multiselect' => true, ), 'choices' => array( 'Antarctica/Casey' => __( 'Casey', 'pageflow-2k21' ), 'Antarctica/Davis' => __( 'Davis', 'pageflow-2k21' ), 'Antarctica/DumontDurville' => __( 'DumontDUrville', 'pageflow-2k21' ), 'Antarctica/Macquarie' => __( 'Macquarie', 'pageflow-2k21' ), 'Antarctica/Mawson' => __( 'Mawson', 'pageflow-2k21' ), 'Antarctica/McMurdo' => __( 'McMurdo', 'pageflow-2k21' ), 'Antarctica/Palmer' => __( 'Palmer', 'pageflow-2k21' ), 'Antarctica/Rothera' => __( 'Rothera', 'pageflow-2k21' ), 'Antarctica/Syowa' => __( 'Syowa', 'pageflow-2k21' ), 'Antarctica/Troll' => __( 'Troll', 'pageflow-2k21' ), 'Antarctica/Vostok' => __( 'Vostok', 'pageflow-2k21' ), 'Atlantic/Azores' => __( 'Azores', 'pageflow-2k21' ), 'Atlantic/Bermuda' => __( 'Bermuda', 'pageflow-2k21' ), 'Atlantic/Canary' => __( 'Canary', 'pageflow-2k21' ), 'Atlantic/Cape_Verde' => __( 'Cape Verde', 'pageflow-2k21' ), 'Atlantic/Faroe' => __( 'Faroe', 'pageflow-2k21' ), 'Atlantic/Madeira' => __( 'Madeira', 'pageflow-2k21' ), 'Atlantic/Reykjavik' => __( 'Reykjavik', 'pageflow-2k21' ), 'Atlantic/South_Georgia' => __( 'South Georgia', 'pageflow-2k21' ), 'Atlantic/Stanley' => __( 'Stanley', 'pageflow-2k21' ), 'Atlantic/St_Helena' => __( 'St Helena', 'pageflow-2k21' ), 'Australia/Adelaide' => __( 'Adelaide', 'pageflow-2k21' ), 'Australia/Brisbane' => __( 'Brisbane', 'pageflow-2k21' ), 'Australia/Broken_Hill' => __( 'Broken Hill', 'pageflow-2k21' ), 'Australia/Currie' => __( 'Currie', 'pageflow-2k21' ), 'Australia/Darwin' => __( 'Darwin', 'pageflow-2k21' ), 'Australia/Eucla' => __( 'Eucla', 'pageflow-2k21' ), 'Australia/Hobart' => __( 'Hobart', 'pageflow-2k21' ), 'Australia/Lindeman' => __( 'Lindeman', 'pageflow-2k21' ), 'Australia/Lord_Howe' => __( 'Lord Howe', 'pageflow-2k21' ), 'Australia/Melbourne' => __( 'Melbourne', 'pageflow-2k21' ), 'Australia/Perth' => __( 'Perth', 'pageflow-2k21' ), 'Australia/Sydney' => __( 'Sydney', 'pageflow-2k21' ), ) ) ) ); // Test of Dropdown Posts Control $wp_customize->add_setting( 'sample_dropdown_posts_control', array( 'default' => $this->defaults['sample_dropdown_posts_control'], 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new Skyrocket_Dropdown_Posts_Custom_Control( $wp_customize, 'sample_dropdown_posts_control', array( 'label' => __( 'Dropdown Posts Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample Dropdown Posts custom control description', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'posts_per_page' => -1, 'orderby' => 'name', 'order' => 'ASC', ), ) ) ); // Test of TinyMCE control $wp_customize->add_setting( 'sample_tinymce_editor', array( 'default' => $this->defaults['sample_tinymce_editor'], 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Skyrocket_TinyMCE_Custom_control( $wp_customize, 'sample_tinymce_editor', array( 'label' => __( 'TinyMCE Control', 'pageflow-2k21' ), 'description' => __( 'This is a TinyMCE Editor Custom Control', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'toolbar1' => 'bold italic bullist numlist alignleft aligncenter alignright link', 'mediaButtons' => true, ) ) ) ); $wp_customize->selective_refresh->add_partial( 'sample_tinymce_editor', array( 'selector' => '.footer-credits', 'container_inclusive' => false, 'render_callback' => 'skyrocket_get_credits_render_callback', 'fallback_refresh' => false, ) ); // Test of Google Font Select Control $wp_customize->add_setting( 'sample_google_font_select', array( 'default' => $this->defaults['sample_google_font_select'], 'sanitize_callback' => 'skyrocket_google_font_sanitization' ) ); $wp_customize->add_control( new Skyrocket_Google_Font_Select_Custom_Control( $wp_customize, 'sample_google_font_select', array( 'label' => __( 'Google Font Control', 'pageflow-2k21' ), 'description' => esc_html__( 'All Google Fonts sorted alphabetically', 'pageflow-2k21' ), 'section' => 'sample_custom_controls_section', 'input_attrs' => array( 'font_count' => 'all', 'orderby' => 'alpha', ), ) ) ); } /** * Register our sample default controls */ public function skyrocket_register_sample_default_controls( $wp_customize ) { // Test of Text Control $wp_customize->add_setting( 'sample_default_text', array( 'default' => $this->defaults['sample_default_text'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( 'sample_default_text', array( 'label' => __( 'Default Text Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'text', 'input_attrs' => array( 'class' => 'my-custom-class', 'style' => 'border: 1px solid rebeccapurple', 'placeholder' => __( 'Enter name...', 'pageflow-2k21' ), ), ) ); // Test of Email Control $wp_customize->add_setting( 'sample_email_text', array( 'default' => $this->defaults['sample_email_text'], 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_email' ) ); $wp_customize->add_control( 'sample_email_text', array( 'label' => __( 'Default Email Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'email' ) ); // Test of URL Control $wp_customize->add_setting( 'sample_url_text', array( 'default' => $this->defaults['sample_url_text'], 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'sample_url_text', array( 'label' => __( 'Default URL Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'url' ) ); // Test of Number Control $wp_customize->add_setting( 'sample_number_text', array( 'default' => $this->defaults['sample_number_text'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_sanitize_integer' ) ); $wp_customize->add_control( 'sample_number_text', array( 'label' => __( 'Default Number Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'number' ) ); // Test of Hidden Control $wp_customize->add_setting( 'sample_hidden_text', array( 'default' => $this->defaults['sample_hidden_text'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( 'sample_hidden_text', array( 'label' => __( 'Default Hidden Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'hidden' ) ); // Test of Date Control $wp_customize->add_setting( 'sample_date_text', array( 'default' => $this->defaults['sample_date_text'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_text_sanitization' ) ); $wp_customize->add_control( 'sample_date_text', array( 'label' => __( 'Default Date Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Text controls Type can be either text, email, url, number, hidden, or date', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'text' ) ); // Test of Standard Checkbox Control $wp_customize->add_setting( 'sample_default_checkbox', array( 'default' => $this->defaults['sample_default_checkbox'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_switch_sanitization' ) ); $wp_customize->add_control( 'sample_default_checkbox', array( 'label' => __( 'Default Checkbox Control', 'pageflow-2k21' ), 'description' => esc_html__( 'Sample Checkbox description', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'checkbox' ) ); // Test of Standard Select Control $wp_customize->add_setting( 'sample_default_select', array( 'default' => $this->defaults['sample_default_select'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_radio_sanitization' ) ); $wp_customize->add_control( 'sample_default_select', array( 'label' => __( 'Standard Select Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'select', 'choices' => array( 'wordpress' => __( 'WordPress', 'pageflow-2k21' ), 'hamsters' => __( 'Hamsters', 'pageflow-2k21' ), 'jet-fuel' => __( 'Jet Fuel', 'pageflow-2k21' ), 'nuclear-energy' => __( 'Nuclear Energy', 'pageflow-2k21' ) ) ) ); // Test of Standard Radio Control $wp_customize->add_setting( 'sample_default_radio', array( 'default' => $this->defaults['sample_default_radio'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_radio_sanitization' ) ); $wp_customize->add_control( 'sample_default_radio', array( 'label' => __( 'Standard Radio Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'radio', 'choices' => array( 'captain-america' => __( 'Captain America', 'pageflow-2k21' ), 'iron-man' => __( 'Iron Man', 'pageflow-2k21' ), 'spider-man' => __( 'Spider-Man', 'pageflow-2k21' ), 'thor' => __( 'Thor', 'pageflow-2k21' ) ) ) ); // Test of Dropdown Pages Control $wp_customize->add_setting( 'sample_default_dropdownpages', array( 'default' => $this->defaults['sample_default_dropdownpages'], 'transport' => 'refresh', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( 'sample_default_dropdownpages', array( 'label' => __( 'Default Dropdown Pages Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'dropdown-pages' ) ); // Test of Textarea Control $wp_customize->add_setting( 'sample_default_textarea', array( 'default' => $this->defaults['sample_default_textarea'], 'transport' => 'refresh', 'sanitize_callback' => 'wp_filter_nohtml_kses' ) ); $wp_customize->add_control( 'sample_default_textarea', array( 'label' => __( 'Default Textarea Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'textarea', 'input_attrs' => array( 'class' => 'my-custom-class', 'style' => 'border: 1px solid #999', 'placeholder' => __( 'Enter message...', 'pageflow-2k21' ), ), ) ); // Test of Color Control $wp_customize->add_setting( 'sample_default_color', array( 'default' => $this->defaults['sample_default_color'], 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( 'sample_default_color', array( 'label' => __( 'Default Color Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'type' => 'color' ) ); // Test of Media Control $wp_customize->add_setting( 'sample_default_media', array( 'default' => $this->defaults['sample_default_media'], 'transport' => 'refresh', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'sample_default_media', array( 'label' => __( 'Default Media Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the description for the Media Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'mime_type' => 'image', 'button_labels' => array( 'select' => __( 'Select File', 'pageflow-2k21' ), 'change' => __( 'Change File', 'pageflow-2k21' ), 'default' => __( 'Default', 'pageflow-2k21' ), 'remove' => __( 'Remove', 'pageflow-2k21' ), 'placeholder' => __( 'No file selected', 'pageflow-2k21' ), 'frame_title' => __( 'Select File', 'pageflow-2k21' ), 'frame_button' => __( 'Choose File', 'pageflow-2k21' ), ) ) ) ); // Test of Image Control $wp_customize->add_setting( 'sample_default_image', array( 'default' => $this->defaults['sample_default_image'], 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sample_default_image', array( 'label' => __( 'Default Image Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the description for the Image Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'button_labels' => array( 'select' => __( 'Select Image', 'pageflow-2k21' ), 'change' => __( 'Change Image', 'pageflow-2k21' ), 'remove' => __( 'Remove', 'pageflow-2k21' ), 'default' => __( 'Default', 'pageflow-2k21' ), 'placeholder' => __( 'No image selected', 'pageflow-2k21' ), 'frame_title' => __( 'Select Image', 'pageflow-2k21' ), 'frame_button' => __( 'Choose Image', 'pageflow-2k21' ), ) ) ) ); // Test of Cropped Image Control $wp_customize->add_setting( 'sample_default_cropped_image', array( 'default' => $this->defaults['sample_default_cropped_image'], 'transport' => 'refresh', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'sample_default_cropped_image', array( 'label' => __( 'Default Cropped Image Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the description for the Cropped Image Control', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'flex_width' => false, 'flex_height' => false, 'width' => 800, 'height' => 400 ) ) ); // Test of Date/Time Control $wp_customize->add_setting( 'sample_date_only', array( 'default' => $this->defaults['sample_date_only'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_date_time_sanitization', ) ); $wp_customize->add_control( new WP_Customize_Date_Time_Control( $wp_customize, 'sample_date_only', array( 'label' => __( 'Default Date Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the Date Time Control but is only displaying a date field. It also has Max and Min years set.', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'include_time' => false, 'allow_past_date' => true, 'twelve_hour_format' => true, 'min_year' => '2016', 'max_year' => '2025', ) ) ); // Test of Date/Time Control $wp_customize->add_setting( 'sample_date_time', array( 'default' => $this->defaults['sample_date_time'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_date_time_sanitization', ) ); $wp_customize->add_control( new WP_Customize_Date_Time_Control( $wp_customize, 'sample_date_time', array( 'label' => __( 'Default Date Control', 'pageflow-2k21' ), 'description' => esc_html__( 'This is the Date Time Control. It also has Max and Min years set.', 'pageflow-2k21' ), 'section' => 'default_controls_section', 'include_time' => true, 'allow_past_date' => true, 'twelve_hour_format' => true, 'min_year' => '2010', 'max_year' => '2020', ) ) ); // Test of Date/Time Control $wp_customize->add_setting( 'sample_date_time_no_past_date', array( 'default' => $this->defaults['sample_date_time_no_past_date'], 'transport' => 'refresh', 'sanitize_callback' => 'skyrocket_date_time_sanitization', ) ); $wp_customize->add_control( new WP_Customize_Date_Time_Control( $wp_customize, 'sample_date_time_no_past_date', array( 'label' => __( 'Default Date Control', 'pageflow-2k21' ), 'description' => esc_html__( "This is the Date Time Control but is only displaying a date field. Past dates are not allowed.", 'pageflow-2k21' ), 'section' => 'default_controls_section', 'include_time' => false, 'allow_past_date' => false, 'twelve_hour_format' => true, 'min_year' => '2016', 'max_year' => '2099', ) ) ); } } /** * Render Callback for displaying the footer credits */ function skyrocket_get_credits_render_callback() { echo skyrocket_get_credits(); } /** * Load all our Customizer Custom Controls */ require_once trailingslashit( dirname(__FILE__) ) . 'custom-controls.php'; /** * Initialise our Customizer settings */ $skyrocket_settings = new skyrocket_initialise_customizer_settings();