/
home
/
rekodeb
/
webrennes
/
wp-content
/
plugins
/
windfall-core
/
elementor
/
widgets
/
Upload File
HOME
<?php /* * Elementor Windfall Features Widget * Author & Copyright: VictorTheme */ namespace Elementor; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Windfall_Services_Slider extends Widget_Base{ /** * Retrieve the widget name. */ public function get_name(){ return 'vt-windfall_services_slider'; } /** * Retrieve the widget title. */ public function get_title(){ return esc_html__( 'Services Slider', 'windfall-core' ); } /** * Retrieve the widget icon. */ public function get_icon() { return 'fa fa-plus-circle'; } /** * Retrieve the list of categories the widget belongs to. */ public function get_categories() { return ['victortheme-category']; } /** * Retrieve the list of scripts the Windfall Windfall Services Slider widget depended on. * Used to set scripts dependencies required to run the widget. */ /* public function get_script_depends() { return ['vt-windfall_services_slider']; } */ /** * Register Windfall Windfall Services Slider widget controls. * Adds different input fields to allow the user to change and customize the widget settings. */ protected function register_controls(){ $this->start_controls_section( 'section_services', [ 'label' => esc_html__( 'Services Slider Options', 'windfall-core' ), ] ); $this->add_control( 'service_section_title', [ 'label' => esc_html__( 'Section Title', 'windfall-core' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Section Title', 'windfall-core' ), 'placeholder' => esc_html__( 'Type section title text here', 'windfall-core' ), 'label_block' => true, ] ); $this->add_control( 'service_section_content', [ 'label' => esc_html__( 'Section Content', 'windfall-core' ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Section Content', 'windfall-core' ), 'placeholder' => esc_html__( 'Type section content here', 'windfall-core' ), 'label_block' => true, ] ); $repeater = new Repeater(); $repeater->add_control( 'services_image', [ 'label' => esc_html__( 'Upload Service Image', 'windfall-core' ), 'type' => Controls_Manager::MEDIA, 'frontend_available' => true, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'description' => esc_html__( 'Set your service featured image.', 'windfall-core'), ] ); $repeater->add_control( 'service_title', [ 'label' => esc_html__( 'Features Title', 'windfall-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( 'Type item title here', 'windfall-core' ), 'default' => esc_html__( 'Access Conversations', 'windfall-core' ), ] ); $repeater->add_control( 'service_title_link', [ 'label' => esc_html__( 'Features Title Link', 'windfall-core' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'windfall-core' ), 'label_block' => true, 'show_external' => true, 'default' => [ 'url' => '', ], ] ); $repeater->add_control( 'service_content', [ 'label' => esc_html__( 'Features Content', 'windfall-core' ), 'default' => esc_html__( 'your content text', 'windfall-core' ), 'placeholder' => esc_html__( 'Type your content here', 'windfall-core' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, ] ); $repeater->add_control( 'service_more_text', [ 'label' => esc_html__( 'Read More Text', 'windfall-core' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Read More', 'windfall-core' ), 'placeholder' => esc_html__( 'Type read more text here', 'windfall-core' ), 'label_block' => true, ] ); $repeater->add_control( 'service_more_link', [ 'label' => esc_html__( 'Read More Link', 'windfall-core' ), 'type' => Controls_Manager::URL, 'placeholder' => 'https://your-link.com', 'default' => [ 'url' => '', ], 'label_block' => true, ] ); $this->add_control( 'services', [ 'label' => esc_html__( 'Features Items', 'windfall-core' ), 'type' => Controls_Manager::REPEATER, 'default' => [ [ 'service_title' => esc_html__( 'Service Item', 'windfall-core' ), ], ], 'fields' => $repeater->get_controls(), 'title_field' => '{{{ service_title }}}', ] ); $this->add_control( 'disable_resizer', [ 'label' => esc_html__( 'Disable Image Resizer', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'If you want to disable image resize, enable it.', 'windfall-core' ), ] ); $this->end_controls_section();// end: Section // Carousel $this->start_controls_section( 'section_carousel', [ 'label' => esc_html__( 'Carousel Options', 'windfall-core' ), ] ); $this->add_responsive_control( 'carousel_items', [ 'label' => esc_html__( 'How many items?', 'windfall-core' ), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 100, 'step' => 1, 'default' => 3, 'description' => esc_html__( 'Enter the number of items to show.', 'windfall-core' ), ] ); $this->add_responsive_control( 'carousel_margin', [ 'label' => __( 'Space Between Items', 'windfall-core' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' =>30, ], 'label_block' => true, ] ); $this->add_control( 'carousel_autoplay_timeout', [ 'label' => __( 'Auto Play Timeout', 'windfall-core' ), 'type' => Controls_Manager::NUMBER, 'default' => 5000, ] ); $this->add_control( 'carousel_loop', [ 'label' => esc_html__( 'Disable Loop?', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'Continuously moving carousel, if enabled.', 'windfall-core' ), ] ); $this->add_control( 'carousel_dots', [ 'label' => esc_html__( 'Dots', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'If you want Carousel Dots, enable it.', 'windfall-core' ), ] ); $this->add_control( 'carousel_nav', [ 'label' => esc_html__( 'Navigation', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'If you want Carousel Navigation, enable it.', 'windfall-core' ), ] ); $this->add_control( 'carousel_autoplay', [ 'label' => esc_html__( 'Autoplay', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'If you want to start Carousel automatically, enable it.', 'windfall-core' ), ] ); $this->add_control( 'carousel_animate_out', [ 'label' => esc_html__( 'Animate Out', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'CSS3 animation out.', 'windfall-core' ), ] ); $this->add_control( 'carousel_animate_in', [ 'label' => esc_html__( 'Animate In', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'CSS3 animation in.', 'windfall-core' ), ] ); $this->add_control( 'carousel_mousedrag', [ 'label' => esc_html__( 'Disable Mouse Drag?', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'If you want to disable Mouse Drag, check it.', 'windfall-core' ), ] ); $this->add_control( 'carousel_autowidth', [ 'label' => esc_html__( 'Auto Width', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'Adjust Auto Width automatically for each carousel items.', 'windfall-core' ), ] ); $this->add_control( 'carousel_autoheight', [ 'label' => esc_html__( 'Auto Height', 'windfall-core' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'windfall-core' ), 'label_off' => esc_html__( 'No', 'windfall-core' ), 'return_value' => 'true', 'description' => esc_html__( 'Adjust Auto Height automatically for each carousel items.', 'windfall-core' ), ] ); $this->end_controls_section();// end: Section // Navigation $this->start_controls_section( 'section_navigation_style', [ 'label' => esc_html__( 'Navigation', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'carousel_nav' => 'true', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'arrow_size', [ 'label' => esc_html__( 'Size', 'windfall-core' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 16, 'max' => 1000, 'step' => 1, ], ], 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev:before, {{WRAPPER}} .owl-carousel .owl-nav .owl-next:before' => 'font-size: {{SIZE}}{{UNIT}} !important;', '{{WRAPPER}} .owl-carousel .owl-nav button.owl-prev, {{WRAPPER}} .owl-carousel .owl-nav button.owl-next' => 'width: calc({{SIZE}}{{UNIT}} + 24px);height: calc({{SIZE}}{{UNIT}} + 24px);', ], ] ); $this->start_controls_tabs( 'nav_arrow_style' ); $this->start_controls_tab( 'nav_arrow_normal', [ 'label' => esc_html__( 'Normal', 'windfall-core' ), ] ); $this->add_control( 'nav_arrow_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev:before, {{WRAPPER}} .owl-carousel .owl-nav .owl-next:before' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'nav_arrow_bg_color', [ 'label' => esc_html__( 'Background Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev, {{WRAPPER}} .owl-carousel .owl-nav .owl-next' => 'background: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'nav_border', 'label' => esc_html__( 'Border', 'windfall-core' ), 'selector' => '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev, {{WRAPPER}} .owl-carousel .owl-nav .owl-next', ] ); $this->end_controls_tab(); // end:Normal tab $this->start_controls_tab( 'nav_arrow_hover', [ 'label' => esc_html__( 'Hover', 'windfall-core' ), ] ); $this->add_control( 'nav_arrow_hover_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev:hover:before, {{WRAPPER}} .owl-carousel .owl-nav .owl-next:hover:before' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'nav_arrow_bg_hover_color', [ 'label' => esc_html__( 'Background Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev:hover, {{WRAPPER}} .owl-carousel .owl-nav .owl-next:hover' => 'background: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'nav_active_border', 'label' => esc_html__( 'Border', 'windfall-core' ), 'selector' => '{{WRAPPER}} .owl-carousel .owl-nav .owl-prev:hover, {{WRAPPER}} .owl-carousel .owl-nav .owl-next:hover', ] ); $this->end_controls_tab(); // end:Hover tab $this->end_controls_tabs(); // end tabs $this->end_controls_section();// end: Section $this->start_controls_section( 'section_dots_style', [ 'label' => esc_html__( 'Dots', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'carousel_dots' => 'true', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'dots_size', [ 'label' => esc_html__( 'Size', 'windfall-core' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], ], 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-dot' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'dots_margin', [ 'label' => __( 'Margin', 'windfall-core' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-dot' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'dots_style' ); $this->start_controls_tab( 'dots_normal', [ 'label' => esc_html__( 'Normal', 'windfall-core' ), ] ); $this->add_control( 'dots_color', [ 'label' => esc_html__( 'Background Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-dot' => 'background: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'dots_border', 'label' => esc_html__( 'Border', 'windfall-core' ), 'selector' => '{{WRAPPER}} .owl-carousel .owl-dot', ] ); $this->end_controls_tab(); // end:Normal tab $this->start_controls_tab( 'dots_active', [ 'label' => esc_html__( 'Active', 'windfall-core' ), ] ); $this->add_control( 'dots_active_color', [ 'label' => esc_html__( 'Background Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .owl-carousel .owl-dot.active' => 'background: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'dots_active_border', 'label' => esc_html__( 'Border', 'windfall-core' ), 'selector' => '{{WRAPPER}} .owl-carousel .owl-dot.active', ] ); $this->end_controls_tab(); // end:Active tab $this->end_controls_tabs(); // end tabs $this->end_controls_section();// end: Section // Section Title $this->start_controls_section( 'section_titl_style', [ 'label' => esc_html__( 'Section Title', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => esc_html__( 'Typography', 'windfall-core' ), 'name' => 'sec_title_typography', 'selector' => '{{WRAPPER}} .services-style-two .section-title', ] ); $this->add_control( 'sec_title_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .services-style-two .section-title' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section();// end: Section // Section Content $this->start_controls_section( 'section_cnt_style', [ 'label' => esc_html__( 'Section Content', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => esc_html__( 'Typography', 'windfall-core' ), 'name' => 'sec_content_typography', 'selector' => '{{WRAPPER}} .services-style-two .section-title-wrap p', ] ); $this->add_control( 'sec_content_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .services-style-two .section-title-wrap p' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section();// end: Section // Title Style $this->start_controls_section( 'section_title_style', [ 'label' => esc_html__( 'Title', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'sasfea_title_typography', 'selector' => '{{WRAPPER}} .service-info .service-title', ] ); $this->start_controls_tabs( 'title_style' ); $this->start_controls_tab( 'title_normal', [ 'label' => esc_html__( 'Normal', 'windfall-core' ), ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .service-info .service-title, {{WRAPPER}} .service-info .service-title a' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // end:Normal tab $this->start_controls_tab( 'title_hover', [ 'label' => esc_html__( 'Hover', 'windfall-core' ), ] ); $this->add_control( 'title_hover_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .service-info .service-title a:hover' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // end:Hover tab $this->end_controls_tabs(); // end tabs $this->end_controls_section();// end: Section // Content Style $this->start_controls_section( 'section_content_style', [ 'label' => esc_html__( 'Content', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'label' => esc_html__( 'Typography', 'windfall-core' ), 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .service-info p', ] ); $this->add_control( 'content_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .service-info p' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section();// end: Section // Link $this->start_controls_section( 'section_link_style', [ 'label' => esc_html__( 'Read More Link', 'windfall-core' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'link_typography', 'selector' => '{{WRAPPER}} .service-info .wndfal-link', ] ); $this->start_controls_tabs( 'link_style' ); $this->start_controls_tab( 'link_normal', [ 'label' => esc_html__( 'Normal', 'windfall-core' ), ] ); $this->add_control( 'link_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .service-info .wndfal-link' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // end:Normal tab $this->start_controls_tab( 'link_hover', [ 'label' => esc_html__( 'Hover', 'windfall-core' ), ] ); $this->add_control( 'link_hover_color', [ 'label' => esc_html__( 'Color', 'windfall-core' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .service-info .wndfal-link:hover' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // end:Hover tab $this->end_controls_tabs(); // end tabs $this->end_controls_section();// end: Section } /** * Render Features widget output on the frontend. * Written in PHP and used to generate the final HTML. */ protected function render() { $settings = $this->get_settings_for_display(); $services = !empty( $settings['services'] ) ? $settings['services'] : []; // Section content $service_section_title = !empty($settings['service_section_title']) ? $settings['service_section_title'] : ''; $service_section_content = !empty($settings['service_section_content']) ? $settings['service_section_content'] : ''; $disable_resizer = !empty( $settings['disable_resizer'] ) ? $settings['disable_resizer'] : ''; $section_title = $service_section_title ? '<h2 class="section-title">'.$service_section_title.'</h2>' : ''; $section_content = $service_section_content ? '<p>'.$service_section_content.'</p>' : ''; // Carousel Options $carousel_items = !empty( $settings['carousel_items'] ) ? $settings['carousel_items'] : ''; $carousel_items_tablet = !empty( $settings['carousel_items_tablet'] ) ? $settings['carousel_items_tablet'] : ''; $carousel_items_mobile = !empty( $settings['carousel_items_mobile'] ) ? $settings['carousel_items_mobile'] : ''; $carousel_margin = !empty( $settings['carousel_margin']['size'] ) ? $settings['carousel_margin']['size'] : ''; $carousel_autoplay_timeout = !empty( $settings['carousel_autoplay_timeout'] ) ? $settings['carousel_autoplay_timeout'] : ''; $carousel_loop = ( isset( $settings['carousel_loop'] ) && ( 'true' == $settings['carousel_loop'] ) ) ? $settings['carousel_loop'] : 'false'; $carousel_dots = ( isset( $settings['carousel_dots'] ) && ( 'true' == $settings['carousel_dots'] ) ) ? true : false; $carousel_nav = ( isset( $settings['carousel_nav'] ) && ( 'true' == $settings['carousel_nav'] ) ) ? true : false; $carousel_autoplay = ( isset( $settings['carousel_autoplay'] ) && ( 'true' == $settings['carousel_autoplay'] ) ) ? true : false; $carousel_animate_out = ( isset( $settings['carousel_animate_out'] ) && ( 'true' == $settings['carousel_animate_out'] ) ) ? true : false; $carousel_animate_in = ( isset( $settings['carousel_animate_in'] ) && ( 'true' == $settings['carousel_animate_in'] ) ) ? true : false; $carousel_mousedrag = ( isset( $settings['carousel_mousedrag'] ) && ( 'true' == $settings['carousel_mousedrag'] ) ) ? $settings['carousel_mousedrag'] : 'false'; $carousel_autowidth = ( isset( $settings['carousel_autowidth'] ) && ( 'true' == $settings['carousel_autowidth'] ) ) ? true : false; $carousel_autoheight = ( isset( $settings['carousel_autoheight'] ) && ( 'true' == $settings['carousel_autoheight'] ) ) ? true : false; // Carousel Data's $carousel_loop = $carousel_loop !== 'true' ? ' data-loop="true"' : ' data-loop="false"'; $carousel_items = $carousel_items ? ' data-items="'. $carousel_items .'"' : ' data-items="3"'; $carousel_margin = $carousel_margin ? ' data-margin="'. $carousel_margin .'"' : ' data-margin="38"'; $carousel_dots = $carousel_dots ? ' data-dots="true"' : ' data-dots="false"'; $carousel_nav = $carousel_nav ? ' data-nav="true"' : ' data-nav="false"'; $carousel_autoplay_timeout = $carousel_autoplay_timeout ? ' data-autoplay-timeout="'. $carousel_autoplay_timeout .'"' : ''; $carousel_autoplay = $carousel_autoplay ? ' data-autoplay="true"' : ''; $carousel_animate_out = $carousel_animate_out === 'true' ? ' data-animateout="fadeOut"' : ''; $carousel_animate_in = $carousel_animate_in === 'true' ? ' data-animatein="fadeIn"' : ''; $carousel_mousedrag = $carousel_mousedrag !== 'true' ? ' data-mouse-drag="true"' : ' data-mouse-drag="false"'; $carousel_autowidth = $carousel_autowidth ? ' data-auto-width="true"' : ''; $carousel_autoheight = $carousel_autoheight ? ' data-auto-height="true"' : ''; $carousel_tablet = $carousel_items_tablet ? ' data-items-tablet="'. $carousel_items_tablet .'"' : ' data-items-tablet="2"'; $carousel_mobile = $carousel_items_mobile ? ' data-items-mobile-landscape="'. $carousel_items_mobile .'"' : ' data-items-mobile-landscape="1"'; $carousel_small_mobile = $carousel_items_mobile ? ' data-items-mobile-portrait="'. $carousel_items_mobile .'"' : ' data-items-mobile-portrait="1"'; // RTL if ( is_rtl() ) { $switch_rtl = ' data-rtl="true"'; } else { $switch_rtl = ' data-rtl="false"'; } $output = '<div class="wndfal-services services-style-two"> <div class="container"> <div class="row"> <div class="col-lg-3"> <div class="section-title-wrap title-style-two"> '.$section_title.$section_content.' </div> </div> <div class="col-lg-9"> <div class="owl-carousel carousel-style-two carousel-style-three" '.$carousel_loop .' '. $carousel_items .' '. $carousel_margin .' '. $carousel_dots .' '. $carousel_nav .' '. $carousel_autoplay_timeout .' '. $carousel_autoplay .' '. $carousel_animate_out .' '. $carousel_mousedrag .' '. $carousel_autowidth .' '. $carousel_autoheight .' '. $carousel_tablet .' '. $carousel_mobile .' '. $carousel_small_mobile.$switch_rtl.'>'; // Group Param Output if( is_array( $services ) && !empty( $services ) ) foreach ( $services as $each_logo ) { $title = !empty( $each_logo['service_title'] ) ? $each_logo['service_title'] : ''; $title_link = !empty( $each_logo['service_title_link']['url'] ) ? $each_logo['service_title_link']['url'] : ''; $title_external = !empty( $each_logo['service_title_link']['is_external'] ) ? 'target="_blank"' : ''; $title_nofollow = !empty( $each_logo['service_title_link']['nofollow'] ) ? 'rel="nofollow"' : ''; $title_link_attr = $title_external.' '.$title_nofollow; $service_more_text = !empty( $each_logo['service_more_text'] ) ? $each_logo['service_more_text'] : ''; $service_more_link = !empty( $each_logo['service_more_link']['url'] ) ? $each_logo['service_more_link']['url'] : ''; $service_more_link_external = !empty( $each_logo['service_more_link']['is_external'] ) ? 'target="_blank"' : ''; $service_more_link_nofollow = !empty( $each_logo['service_more_link']['nofollow'] ) ? 'rel="nofollow"' : ''; $service_more_link_attr = !empty( $service_more_link ) ? $service_more_link_external.' '.$service_more_link_nofollow : ''; $image_url = wp_get_attachment_url( $each_logo['services_image']['id'] ); $alt = get_post_meta($each_logo['services_image']['id'], '_wp_attachment_image_alt', true); $content = !empty( $each_logo['service_content'] ) ? $each_logo['service_content'] : ''; $icon = !empty( $each_logo['services_icon'] ) ? $each_logo['services_icon'] : ''; if($disable_resizer) { $featured_img_actual = $image_url; } else { if(class_exists('Aq_Resize')) { $image_url = aq_resize( $image_url, '270', '190', true ); } else {$image_url = $image_url;} $featured_img_actual = ( $image_url ) ? $image_url : WINDFALL_IMAGES . '/holders/270x190.png'; } $feature_icon = $icon ? ' <i class="'.$icon.'" aria-hidden="true"></i>' : ''; $feature_image = $image_url ? '<div class="wndfal-image"><img src="'.$featured_img_actual.'" alt="'.$alt.'"></div>' : ''; $service_content = $content ? '<p>'.$content.'</p>' : ''; $link = $service_more_link ? '<a href="'.$service_more_link.'" '.$service_more_link_attr.' class="wndfal-link">'.$service_more_text.'<i class="fa fa-angle-right" aria-hidden="true"></i></a>' : ''; $image_actual = $title_link ? '<a href="'.esc_url($title_link).'" '.$title_link_attr.'>'.$feature_image.'</a>' : $feature_image; $service_title_link = $title_link ? '<a href="'.esc_url($title_link).'" '.$title_link_attr.'>'.$title.'</a>' : $title; $service_title = $title ? '<h4 class="service-title">'.$service_title_link.'</h4>' : ''; $services_image = $feature_image; $output .= '<div class="item"> <div class="service-item"> '.$image_actual.' <div class="service-info"> '.$service_title.$service_content.$link.' </div> </div> </div>'; } $output .= '</div></div></div></div></div>'; echo $output; } /** * Render Features widget output in the editor. * Written as a Backbone JavaScript template and used to generate the live preview. */ //protected function _content_template(){} } Plugin::instance()->widgets_manager->register_widget_type( new Windfall_Services_Slider() );