add_panel( 'gtl_site_layout_panel', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Layout Setting', 'business-curve'), ) ); // layout type $wp_customize->add_section( 'gtl_layout_type', array( 'title' => __('Layout type', 'business-curve'), 'priority' => 10, 'panel' => 'gtl_site_layout_panel', ) ); $wp_customize->add_setting( 'site_layout_type', array( 'default' => 'full-width-layout', 'sanitize_callback' => 'gtl_sanitize_site_layout', ) ); $wp_customize->add_control( 'site_layout_type', array( 'type' => 'radio', 'label' => __('Site layout', 'business-curve'), 'section' => 'gtl_layout_type', 'description' => __('Select the layout type for your website', 'business-curve'), 'choices' => array( 'full-width-layout' => __('Full Width', 'business-curve'), 'box-layout' => __('Boxed', 'business-curve'), ), ) ); // site container type $wp_customize->add_setting( 'site_container_type', array( 'default' => 'container-large', 'sanitize_callback' => 'gtl_sanitize_site_container', ) ); $wp_customize->add_control( 'site_container_type', array( 'type' => 'radio', 'label' => __('Site Container', 'business-curve'), 'section' => 'gtl_layout_type', 'description' => __('Select the container type for your website', 'business-curve'), 'choices' => array( 'container-large' => __('Large', 'business-curve'), 'container-medium' => __('Medium', 'business-curve'), 'container-small' => __('Small', 'business-curve'), 'container-fluid' => __('Fullwidth/Fluid', 'business-curve'), ), ) ); /** * sanitization */ //site layout function gtl_sanitize_site_layout( $input ) { $valid = array( 'full-width-layout' => __('Full Width', 'business-curve'), 'box-layout' => __('Boxed', 'business-curve'), 'left-header-layout' => __('Left Menu', 'business-curve'), 'right-header-layout' => __('Right Menu', 'business-curve'), ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } // site container function gtl_sanitize_site_container( $input ) { $valid = array( 'container-large' => __('Large', 'business-curve'), 'container-medium' => __('Medium', 'business-curve'), 'container-small' => __('Small', 'business-curve'), 'container-fluid' => __('Fullwidth/Fluid', 'business-curve'), ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } }