add_section( 'popular_activities_section', array( 'title' => __( 'Popular Activities Section', 'adventure-travel' ), 'priority' => 25, 'panel' => 'frontpage_settings', ) ); /** Open Link in new tab */ $wp_customize->add_setting( 'ed_popular_activities_section', array( 'default' => true, 'sanitize_callback' => 'adventure_travel_sanitize_checkbox' ) ); $wp_customize->add_control( new Adventure_Travel_Controls_Toggle_Control( $wp_customize, 'ed_popular_activities_section', array( 'section' => 'popular_activities_section', 'label' => __( 'Enable Popular Activities', 'adventure-travel' ), ) ) ); /** Background Image */ $wp_customize->add_setting( 'popular_activities_bg_image', array( 'default' => get_template_directory_uri() . '/images/testimonial-bg.jpg', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'popular_activities_bg_image', array( 'label' => __( 'Background Image', 'adventure-travel' ), 'section' => 'popular_activities_section', ) ) ); /** Title */ $wp_customize->add_setting( 'popular_activities_title', array( 'default' => __( 'Popular Activities', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'popular_activities_title', array( 'label' => __( 'Popular Activities Title', 'adventure-travel' ), 'section' => 'popular_activities_section', 'type' => 'text', ) ); /** Title */ $wp_customize->add_setting( 'popular_activities_desc', array( 'default' => __( 'you can find the popular travel activities', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'popular_activities_desc', array( 'label' => __( 'Popular Activities Desc', 'adventure-travel' ), 'section' => 'popular_activities_section', 'type' => 'text', ) ); if( Adventure_Travel_is_wp_travel_engine_activated() ){ $popular_activities_no = '8'; for ( $i = 1; $i <= $popular_activities_no; $i++ ) { $wp_customize->add_setting( "popular_activities_$i", array( 'default' => '', 'sanitize_callback' => 'adventure_travel_sanitize_select', ) ); $wp_customize->add_control( "popular_activities_$i", array( 'label' => esc_html__( 'Popular Activities ', 'adventure-travel' ) . ' - ' . $i, 'section' => 'popular_activities_section', 'type' => 'select', 'choices' => adventure_travel_get_categories( true, 'activities', false ), ) ); } } else { $wp_customize->add_setting( 'popular_activities_recommend', array( 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new Adventure_Travel_Plugin_Recommend_Control( $wp_customize, 'popular_activities_recommend', array( 'section' => 'popular_activities_section', 'label' => __( 'Choose Popular Activities', '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' ), '', '' ), ) ) ); } /** Title */ $wp_customize->add_setting( 'activities_read_more', array( 'default' => __( 'Read More', 'adventure-travel' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'activities_read_more', array( 'label' => __( 'Activities Read More', 'adventure-travel' ), 'section' => 'popular_activities_section', 'type' => 'text', ) ); $wp_customize->selective_refresh->add_partial( 'activities_read_more', array( 'selector' => '.pop-activities-section .activities-block .activities-content-wrap .btn-readmore', 'render_callback' => 'adventure_travel_customize_partial_activities_read_more', ) ); } add_action( 'customize_register', 'adventure_travel_customize_register_frontpage_pop_activities_section' );