add_setting( 'bc_affiliate1_image' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_affiliate1_image', array( 'label' => __( 'Affiliate 1 Image', 'broadcast-lite' ), 'description' => __( 'This image can be square or rectangular, something around 200 x 200 pixels works well. ', 'broadcast-lite'), 'section' => 'bc_affiliate_settings1', 'settings' => 'bc_affiliate1_image', ) ) ); // END SETTING // SETTING - bc_affiliate1_link $wp_customize->add_setting( 'bc_affiliate1_link' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_affiliate1_link', array( 'label' => __( 'Affiliate 1 Link', 'broadcast-lite' ), 'description' => __( 'This URL should start with http:// or https:// ', 'broadcast-lite'), 'type' => 'text', 'section' => 'bc_affiliate_settings1', 'settings' => 'bc_affiliate1_link', ) ); // END SETTING // SETTING - bc_affiliate2_image $wp_customize->add_setting( 'bc_affiliate2_image' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_affiliate2_image', array( 'label' => __( 'Affiliate 2 Image', 'broadcast-lite' ), 'description' => __( 'This image can be square or rectangular, something around 200 x 200 pixels works well. ', 'broadcast-lite'), 'section' => 'bc_affiliate_settings2', 'settings' => 'bc_affiliate2_image', ) ) ); // END SETTING // SETTING - bc_affiliate2_link $wp_customize->add_setting( 'bc_affiliate2_link' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_affiliate2_link', array( 'label' => __( 'Affiliate 2 Link', 'broadcast-lite' ), 'description' => __( 'This URL should start with http:// or https:// ', 'broadcast-lite'), 'type' => 'text', 'section' => 'bc_affiliate_settings2', 'settings' => 'bc_affiliate2_link', ) ); // END SETTING // SETTING - bc_affiliate3_image $wp_customize->add_setting( 'bc_affiliate3_image' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_affiliate3_image', array( 'label' => __( 'Affiliate 3 Image', 'broadcast-lite' ), 'description' => __( 'This image can be square or rectangular, something around 200 x 200 pixels works well. ', 'broadcast-lite'), 'section' => 'bc_affiliate_settings3', 'settings' => 'bc_affiliate3_image', ) ) ); // END SETTING // SETTING - bc_affiliate3_link $wp_customize->add_setting( 'bc_affiliate3_link' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_affiliate3_link', array( 'label' => __( 'Affiliate 3 Link', 'broadcast-lite' ), 'description' => __( 'This URL should start with http:// or https:// ', 'broadcast-lite'), 'type' => 'text', 'section' => 'bc_affiliate_settings3', 'settings' => 'bc_affiliate3_link', ) ); // END SETTING // SETTING - bc_affiliate4_image $wp_customize->add_setting( 'bc_affiliate4_image' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_affiliate4_image', array( 'label' => __( 'Affiliate 4 Image', 'broadcast-lite' ), 'description' => __( 'This image can be square or rectangular, something around 200 x 200 pixels works well. ', 'broadcast-lite'), 'section' => 'bc_affiliate_settings4', 'settings' => 'bc_affiliate4_image', ) ) ); // END SETTING // SETTING - bc_affiliate4_link $wp_customize->add_setting( 'bc_affiliate4_link' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_affiliate4_link', array( 'label' => __( 'Affiliate 4 Link', 'broadcast-lite' ), 'description' => __( 'This URL should start with http:// or https:// ', 'broadcast-lite'), 'type' => 'text', 'section' => 'bc_affiliate_settings4', 'settings' => 'bc_affiliate4_link', ) ); // END SETTING // SETTING - bc_affiliates_title $wp_customize->add_setting( 'bc_affiliates_title' , array( 'default' => 'Affiliates', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bc_affiliates_title', array( 'label' => __( 'Affiliates Title', 'broadcast-lite' ), 'description' => __( 'Change the title of the Affiliates section. Leave blank for no title.', 'broadcast-lite' ), 'type' => 'text', 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_title', ) ); // SETTING - bc_affiliates_check $wp_customize->add_setting( 'bc_affiliates_check' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_checkbox', ) ); $wp_customize->add_control( 'bc_affiliates_check', array( 'label' => __( 'Hide Affiliates?', 'broadcast-lite' ), 'description' => __( 'Check this box to hide the Affiliates section.', 'broadcast-lite'), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_check', 'type' => 'checkbox', ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_affiliates_bg_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_affiliates_bg_color', array( 'label' => __( 'Background Color', 'broadcast-lite' ), 'description' => __( 'Choose a background color for this section.', 'broadcast-lite'), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_bg_color', ) ) ); // END SETTING // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_affiliates_title_color' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_affiliates_title_color', array( 'label' => __( 'Title Color', 'broadcast-lite' ), 'description' => __( 'Choose a title color for this section.', 'broadcast-lite'), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_title_color', ) ) ); // END SETTING // SETTING - bc_affiliates_bg_image $wp_customize->add_setting( 'bc_affiliates_bg_image' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_affiliates_bg_image', array( 'label' => __( '(Advanced) Background Image', 'broadcast-lite' ), 'description' => __( 'This image should be large, as it\'s set to cover the entire section.', 'broadcast-lite'), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_bg_image', ) ) ); // END SETTING // SETTING - bc_affiliates_bg_size $wp_customize->add_setting( 'bc_affiliates_bg_size', array( 'default' => 'cover', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); // CONTROL - Dropdown for Background Image Size $wp_customize->add_control( 'bc_affiliates_bg_size', array( 'type' => 'select', 'label' => __( 'Background Image Size', 'broadcast-lite' ), 'description' => __( 'Choose how the background image should be displayed.', 'broadcast-lite' ), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_bg_size', 'choices' => array( 'cover' => __( 'Cover', 'broadcast-lite' ), 'contain' => __( 'Contain', 'broadcast-lite' ), ), ) ); // SETTING - bc_colour_theme $wp_customize->add_setting( 'bc_affiliates_gradient' , array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_textarea_field' ) ); $wp_customize->add_control( 'bc_affiliates_gradient', array( 'label' => __( '(Advanced) Gradient Background', 'broadcast-lite' ), 'description' => __( 'If you\'d like to use a gradient background instead of solid color, add your gradient CSS here. You can generate CSS here.', 'broadcast-lite'), 'section' => 'bc_affiliate_links', 'settings' => 'bc_affiliates_gradient', 'type' => 'textarea', ) ); // END SETTING } add_action( 'customize_register', 'broadcast_customize_affiliates_settings' );