6 * @subpackage Shop Isle
10 * Register settings and controls for customize
14 function shop_isle_customize_register( $wp_customize ) {
16 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
18 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
20 $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
22 $wp_customize->get_setting( 'background_color' )->default = '';
24 $wp_customize->remove_control( 'display_header_text' );
26 /* Sections Customizing */
28 $wp_customize->add_panel(
29 'shop_isle_front_page_sections', array(
31 'title' => esc_html__( 'Frontpage sections', 'shop-isle' ),
36 * Repeater Sanitization function
38 * @param string $input Input.
39 * @return mixed|string|void
41 function shop_isle_sanitize_repeater( $input ) {
43 $input_decoded = json_decode( $input, true );
44 $allowed_html = array(
60 if ( ! empty( $input_decoded ) ) {
61 foreach ( $input_decoded as $boxk => $box ) {
62 foreach ( $box as $key => $value ) {
63 if ( $key == 'text' ) {
64 $value = html_entity_decode( $value );
65 $input_decoded[ $boxk ][ $key ] = wp_kses( $value, $allowed_html );
67 $input_decoded[ $boxk ][ $key ] = wp_kses_post( force_balance_tags( $value ) );
72 return json_encode( $input_decoded );
79 * Sanitize checkbox output.
81 function shop_isle_sanitize_checkbox( $input ) {
82 return ( isset( $input ) && true === (bool) $input ? true : false );
86 * Enqueue customize preview script.
88 function shop_isle_wp_themeisle_customize_preview_js() {
89 wp_enqueue_script( 'wp_themeisle_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );
91 add_action( 'customize_preview_init', 'shop_isle_wp_themeisle_customize_preview_js' );