add_section( 'stat_counter_section', array( 'title' => __( 'Stat Counter Section', 'adventure-travel' ), 'priority' => 25, 'panel' => 'frontpage_settings', ) ); /** ed Stat COunter */ $wp_customize->add_setting( 'ed_stat_counter_section', array( 'default' => false, 'sanitize_callback' => 'adventure_travel_sanitize_checkbox' ) ); $wp_customize->add_control( new Adventure_Travel_Controls_Toggle_Control( $wp_customize, 'ed_stat_counter_section', array( 'section' => 'stat_counter_section', 'label' => __( 'Enable Stat Counter', 'adventure-travel' ), ) ) ); /** Title */ $wp_customize->add_setting( 'stat_counter_title', array( 'default' => __( 'Stats Counter', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'stat_counter_title', array( 'label' => __( 'Stats Counter Title', 'adventure-travel' ), 'section' => 'stat_counter_section', 'type' => 'text', ) ); /** desc */ $wp_customize->add_setting( 'stat_counter_desc', array( 'default' => __( 'Let your visitors know why they should trust you.', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'stat_counter_desc', array( 'label' => __( 'Stats Counter Desc', 'adventure-travel' ), 'section' => 'stat_counter_section', 'type' => 'text', ) ); /** Stat counter */ $wp_customize->add_setting( new Adventure_Travel_Repeater_Setting( $wp_customize, 'stat_counter', array( 'default' => '', 'sanitize_callback' => array( 'Adventure_Travel_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Adventure_Travel_Control_Repeater( $wp_customize, 'stat_counter', array( 'section' => 'stat_counter_section', 'label' => __( 'Stat Counter', 'adventure-travel' ), 'fields' => array( 'font' => array( 'type' => 'font', 'label' => __( 'Font Awesome Icon', 'adventure-travel' ), 'description' => __( 'Example: fa-bell', 'adventure-travel' ), ), 'number' => array( 'type' => 'text', 'label' => __( 'Number', 'adventure-travel' ), ), 'title' => array( 'type' => 'text', 'label' => __( 'Title', 'adventure-travel' ), ) ), 'row_label' => array( 'type' => 'field', 'value' => __( 'Stat Counter', 'adventure-travel' ), 'field' => 'link' ), 'choices' => array( 'limit' => 8, ), ) ) ); } add_action( 'customize_register', 'adventure_travel_customize_register_frontpage_stat_counter' );