add_section( 'popular_destination_section', array( 'title' => __( 'Popular Destination Section', 'adventure-travel' ), 'priority' => 25, 'panel' => 'frontpage_settings', ) ); /** Open Link in new tab */ $wp_customize->add_setting( 'ed_popular_destination_section', array( 'default' => true, 'sanitize_callback' => 'adventure_travel_sanitize_checkbox' ) ); $wp_customize->add_control( new Adventure_Travel_Controls_Toggle_Control( $wp_customize, 'ed_popular_destination_section', array( 'section' => 'popular_destination_section', 'label' => __( 'Enable Popular Destination', 'adventure-travel' ), ) ) ); /** Title */ $wp_customize->add_setting( 'popular_destination_title', array( 'default' => __( 'Popular Destination', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'popular_destination_title', array( 'label' => __( 'Popular Destination Title', 'adventure-travel' ), 'section' => 'popular_destination_section', 'type' => 'text', ) ); /** Title */ $wp_customize->add_setting( 'popular_destination_desc', array( 'default' => __( 'You can find popular destination here', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'popular_destination_desc', array( 'label' => __( 'Popular Destination Description', 'adventure-travel' ), 'section' => 'popular_destination_section', 'type' => 'text', ) ); if( Adventure_Travel_is_wp_travel_engine_activated() ){ $popular_destination_no = '8'; for ( $i = 1; $i <= $popular_destination_no; $i++ ) { $wp_customize->add_setting( "popular_destination_$i", array( 'default' => '', 'sanitize_callback' => 'adventure_travel_sanitize_select', ) ); $wp_customize->add_control( "popular_destination_$i", array( 'label' => esc_html__( 'Popular Destination ', 'adventure-travel' ) . ' - ' . $i, 'section' => 'popular_destination_section', 'type' => 'select', 'choices' => adventure_travel_get_categories( true, 'destination', false ), ) ); } } else { $wp_customize->add_setting( 'popular_dests_recommend', array( 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new Adventure_Travel_Plugin_Recommend_Control( $wp_customize, 'popular_dests_recommend', array( 'section' => 'popular_destination_section', 'label' => __( 'Choose Popular Destination', 'adventure-travel' ), 'capability' => 'install_plugins', 'plugin_slug' => 'wp-travel-engine',//This is the slug of recommended plugin. /* translators: 1: strong tag start, 2: strong tag end */ 'description' => sprintf( __( 'Please install and activate the recommended plugin %1$s WP Travel Engine %2$s. After that option related with this section will be visible.', 'adventure-travel' ), '', '' ), ) ) ); } } add_action( 'customize_register', 'adventure_travel_customize_register_frontpage_pop_dest_section' );