add_panel( 'anirohotellight_front_page_rooms', array( 'title' => esc_html__( 'Front page section "Rooms"', 'aniro-hotel-light' ), 'description' => esc_html__( 'Front page section "Rooms" - options.', 'aniro-hotel-light' ), 'priority' => 40, ) ); //****************************************************************************** //Add section "Front page Our Team" //****************************************************************************** $wp_customize->add_section( 'anirohotellight_front_page_rooms' , array( 'title' => esc_html__( 'Front page rooms', 'aniro-hotel-light' ), 'panel' => 'anirohotellight_front_page_rooms', 'priority' => 1, 'description' => esc_html__( 'Front page rooms.', 'aniro-hotel-light' ) ) ); /*******************************************************************************************/ //Rooms Title $wp_customize->add_setting('anirohotellight_rooms_title', array( 'default' => 'Rooms', 'sanitize_callback' => 'wp_filter_nohtml_kses' ) ); $wp_customize->add_control('anirohotellight_rooms_title', array( 'section' => 'anirohotellight_front_page_rooms', 'label' => 'Title for "Rooms" section:', 'type' => 'text' ) ); /*******************************************************************************************/ //Button text $wp_customize->add_setting('anirohotellight_rooms_btn_text', array( 'default' => 'See all rooms', 'sanitize_callback' => 'wp_filter_nohtml_kses' ) ); $wp_customize->add_control('anirohotellight_rooms_btn_text', array( 'section' => 'anirohotellight_front_page_rooms', 'label' => 'Button: text for button that will show all rooms', 'type' => 'text' ) ); /*******************************************************************************************/ //Button link $wp_customize->add_setting('anirohotellight_rooms_btn_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control('anirohotellight_rooms_btn_link', array( 'section' => 'anirohotellight_front_page_rooms', 'label' => 'Button: link to "Rooms" for button that will show all rooms', 'type' => 'url' ) ); /*******************************************************************************************/ //How many rooms show $wp_customize->add_setting( 'anirohotellight_rooms_numbers', array( 'sanitize_callback' => 'absint', 'default' => 4, )); $wp_customize->add_control ( 'anirohotellight_rooms_numbers', array( 'type' => 'number', 'label' => esc_html__( 'How many rooms you want to show in one line on section "Rooms":', 'aniro-hotel-light' ), 'section' => 'anirohotellight_front_page_rooms', 'settings' => 'anirohotellight_rooms_numbers', 'input_attrs' => array( 'min' => 3, 'max' => 4, 'step' => 1, 'style' => 'margin-bottom: 15px; padding: 15px;', ), )); //How many rooms show in one line $wp_customize->add_setting( 'anirohotellight_rooms_numbers_of_lines', array( 'sanitize_callback' => 'absint', 'default' => 1, )); $wp_customize->add_control ( 'anirohotellight_rooms_numbers_of_lines', array( 'type' => 'number', 'label' => esc_html__( 'How many lines with rooms you want to show:', 'aniro-hotel-light' ), 'section' => 'anirohotellight_front_page_rooms', 'settings' => 'anirohotellight_rooms_numbers_of_lines', 'input_attrs' => array( 'min' => 1, 'max' => 2, 'step' => 1, 'style' => 'margin-bottom: 15px; padding: 15px;', ), )); //****************************************************************************** //Add section "Show/hide section" //****************************************************************************** $wp_customize->add_section( 'front_page_show_hide_rooms_section' , array( 'title' => esc_html__( 'Show/hide section', 'aniro-hotel-light' ), 'panel' => 'anirohotellight_front_page_rooms', 'priority' => 100, 'description' => esc_html__( 'Show/hide this section.', 'aniro-hotel-light' ) ) ); /*********************************************/ // Show/hide panel with telephone number $wp_customize->add_setting('front_page_show_hide_rooms', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_checkbox', )); $wp_customize->add_control('front_page_show_hide_rooms', array( 'type' => 'checkbox', 'label' => esc_html__( 'Hide this section?', 'aniro-hotel-light' ), 'section' => 'front_page_show_hide_rooms_section', ) );