Loading...
IONS, 'default' => [ 'top' => 50, 'right' => 50, 'bottom' => 50, 'left' => 50, 'unit' => '%', ], 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-slider-dot' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'grid_slider_dots_gutter', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Gutter', 'wpr-addons' ), 'size_units' => ['px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 7, ], 'selectors' => [ '{{WRAPPER}}.wpr-grid-slider-dots-horizontal .wpr-grid-slider-dot' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}}.wpr-grid-slider-dots-vertical .wpr-grid-slider-dot' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], 'render_type' => 'template', 'separator' => 'before', ] ); $this->add_control_grid_slider_dots_hr(); $this->add_responsive_control( 'grid_slider_dots_vr', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Vertical Position', 'wpr-addons' ), 'size_units' => [ '%', 'px' ], 'range' => [ '%' => [ 'min' => -20, 'max' => 120, ], 'px' => [ 'min' => -200, 'max' => 2000, ], ], 'default' => [ 'unit' => '%', 'size' => 96, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-slider-dots' => 'top: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // End Controls Section // Styles ==================== // Section: Filters ---------- $this->start_controls_section( 'section_style_filters', [ 'label' => esc_html__( 'Filters', 'wpr-addons' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, 'condition' => [ 'layout_select!' => 'slider', 'layout_filters' => 'yes', ], ] ); $this->add_control( 'active_styles_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => esc_html__('Apply active filter styles from the hover tab.', 'wpr-addons'), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info' ] ); $this->start_controls_tabs( 'tabs_grid_filters_style' ); $this->start_controls_tab( 'tab_grid_filters_normal', [ 'label' => esc_html__( 'Normal', 'wpr-addons' ), ] ); $this->add_control( 'filters_color', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#7A7A7A', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li a' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'filters_bg_color', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > span' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'filters_border_color', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#E8E8E8', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > span' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'filters_box_shadow', 'selector' => '{{WRAPPER}} .wpr-grid-filters li > a, {{WRAPPER}} .wpr-grid-filters li > span', ] ); $this->add_control( 'filters_wrapper_color', [ 'label' => esc_html__( 'Wrapper Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters' => 'background-color: {{VALUE}}', ], 'separator' => 'after', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_grid_filters_hover', [ 'label' => esc_html__( 'Hover', 'wpr-addons' ), ] ); $this->add_control( 'filters_color_hr', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > span:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > .wpr-active-filter' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'filters_bg_color_hr', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#605BE5', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a:hover' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > span:hover' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > .wpr-active-filter' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'filters_border_color_hr', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#E8E8E8', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a:hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > span:hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-filters li > .wpr-active-filter' => 'border-color: {{VALUE}}', ] ] ); $this->add_control_filters_pointer_color_hr(); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'filters_box_shadow_hr', 'selector' => '{{WRAPPER}} .wpr-grid-filters li > a:hover, {{WRAPPER}} .wpr-grid-filters li > span:hover', 'separator' => 'after', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control_filters_pointer(); $this->add_control_filters_pointer_height(); $this->add_control_filters_pointer_animation(); $this->add_control( 'filters_transition_duration', [ 'label' => esc_html__( 'Transition Duration', 'wpr-addons' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.1, 'min' => 0, 'max' => 5, 'step' => 0.1, 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-grid-filters li > span' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-pointer-item:before' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-pointer-item:after' => 'transition-duration: {{VALUE}}s', ], 'separator' => 'after', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'filters_typography', 'selector' => '{{WRAPPER}} .wpr-grid-filters li' ] ); $this->add_control( 'filters_border_type', [ 'label' => esc_html__( 'Border Type', 'wpr-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__( 'None', 'wpr-addons' ), 'solid' => esc_html__( 'Solid', 'wpr-addons' ), 'double' => esc_html__( 'Double', 'wpr-addons' ), 'dotted' => esc_html__( 'Dotted', 'wpr-addons' ), 'dashed' => esc_html__( 'Dashed', 'wpr-addons' ), 'groove' => esc_html__( 'Groove', 'wpr-addons' ), ], 'default' => 'none', 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'border-style: {{VALUE}};', '{{WRAPPER}} .wpr-grid-filters li > span' => 'border-style: {{VALUE}};', ], 'separator' => 'before', ] ); $this->add_control( 'filters_border_width', [ 'label' => esc_html__( 'Border Width', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-filters li > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'filters_border_type!' => 'none', ], ] ); $this->add_responsive_control( 'filters_distance_from_grid', [ 'label' => esc_html__( 'Distance From Grid', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 25, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->add_control( 'filters_icon_spacing', [ 'label' => esc_html__( 'Extra Icon Spacing', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 25, ], ], 'default' => [ 'unit' => 'px', 'size' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-filters-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'filters_margin', [ 'label' => esc_html__( 'Margin', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 0, 'right' => 5, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'filters_padding', [ 'label' => esc_html__( 'Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', ], 'default' => [ 'top' => 3, 'right' => 15, 'bottom' => 3, 'left' => 15, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-filters li > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'filters_wrapper_padding', [ 'label' => esc_html__( 'Wrapper Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'filters_radius', [ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 3, 'right' => 3, 'bottom' => 3, 'left' => 3, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-filters li > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-filters li > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); // Styles ==================== // Section: Pagination ---------- $this->start_controls_section( 'section_style_pagination', [ 'label' => esc_html__( 'Pagination', 'wpr-addons' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, 'condition' => [ 'layout_select!' => 'slider', 'layout_pagination' => 'yes', ], ] ); $this->start_controls_tabs( 'tabs_grid_pagination_style' ); $this->start_controls_tab( 'tab_grid_pagination_normal', [ 'label' => esc_html__( 'Normal', 'wpr-addons' ), ] ); $this->add_control( 'pagination_color', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination svg' => 'fill: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'pagination_bg_color', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#605BE5', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-pagination-finish' => 'color: {{VALUE}}', ] ] ); $this->add_control( 'pagination_border_color', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#E8E8E8', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'pagination_box_shadow', 'selector' => '{{WRAPPER}} .wpr-grid-pagination a, {{WRAPPER}} .wpr-grid-pagination > div > span', ] ); $this->add_control( 'pagination_loader_color', [ 'label' => esc_html__( 'Loader Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#605BE5', 'selectors' => [ '{{WRAPPER}} .wpr-double-bounce .wpr-child' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-wave .wpr-rect' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-spinner-pulse' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-chasing-dots .wpr-child' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-three-bounce .wpr-child' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-fading-circle .wpr-circle:before' => 'background-color: {{VALUE}}', ], 'condition' => [ 'pagination_type' => [ 'load-more', 'infinite-scroll' ] ] ] ); $this->add_control( 'pagination_wrapper_color', [ 'label' => esc_html__( 'Wrapper Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination' => 'background-color: {{VALUE}}', ], 'separator' => 'after', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_grid_pagination_hover', [ 'label' => esc_html__( 'Hover', 'wpr-addons' ), ] ); $this->add_control( 'pagination_color_hr', [ 'label' => esc_html__( 'Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination a:hover svg' => 'fill: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span:not(.wpr-disabled-arrow):hover' => 'color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'pagination_bg_color_hr', [ 'label' => esc_html__( 'Background Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#4A45D2', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a:hover' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span:not(.wpr-disabled-arrow):hover' => 'background-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'background-color: {{VALUE}}', ] ] ); $this->add_control( 'pagination_border_color_hr', [ 'label' => esc_html__( 'Border Color', 'wpr-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#E8E8E8', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a:hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination > div > span:not(.wpr-disabled-arrow):hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'border-color: {{VALUE}}', ] ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'pagination_box_shadow_hr', 'selector' => '{{WRAPPER}} .wpr-grid-pagination a:hover, {{WRAPPER}} .wpr-grid-pagination > div > span:not(.wpr-disabled-arrow):hover', 'separator' => 'after', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'pagination_transition_duration', [ 'label' => esc_html__( 'Transition Duration', 'wpr-addons' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.1, 'min' => 0, 'max' => 5, 'step' => 0.1, 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-grid-pagination svg' => 'transition-duration: {{VALUE}}s', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'transition-duration: {{VALUE}}s', ], 'separator' => 'after', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'pagination_typography', 'selector' => '{{WRAPPER}} .wpr-grid-pagination' ] ); $this->add_responsive_control( 'pagination_icon_size', [ 'label' => esc_html__( 'Icon Size', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 5, 'max' => 30, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination svg' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'pagination_border_type', [ 'label' => esc_html__( 'Border Type', 'wpr-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__( 'None', 'wpr-addons' ), 'solid' => esc_html__( 'Solid', 'wpr-addons' ), 'double' => esc_html__( 'Double', 'wpr-addons' ), 'dotted' => esc_html__( 'Dotted', 'wpr-addons' ), 'dashed' => esc_html__( 'Dashed', 'wpr-addons' ), 'groove' => esc_html__( 'Groove', 'wpr-addons' ), ], 'default' => 'none', 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'border-style: {{VALUE}};', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'border-style: {{VALUE}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'border-style: {{VALUE}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'border-style: {{VALUE}};', ], 'separator' => 'before', ] ); $this->add_control( 'pagination_border_width', [ 'label' => esc_html__( 'Border Width', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 1, 'right' => 1, 'bottom' => 1, 'left' => 1, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'pagination_border_type!' => 'none', ], ] ); $this->add_responsive_control( 'pagination_distance_from_grid', [ 'label' => esc_html__( 'Distance From Grid', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 35, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination' => 'margin-top: {{SIZE}}{{UNIT}};', ], 'separator' => 'before' ] ); $this->add_control( 'pagination_gutter', [ 'label' => esc_html__( 'Gutter', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 25, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'pagination_icon_spacing', [ 'label' => esc_html__( 'Icon Spacing', 'wpr-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 25, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination .wpr-prev-post-link i' => 'padding-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-next-post-link i' => 'padding-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-first-page i' => 'padding-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-prev-page i' => 'padding-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-next-page i' => 'padding-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-last-page i' => 'padding-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-prev-post-link svg' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-next-post-link svg' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-first-page svg' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-prev-page svg' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-next-page svg' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination .wpr-last-page svg' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'pagination_padding', [ 'label' => esc_html__( 'Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 8, 'right' => 15, 'bottom' => 8, 'left' => 15, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'pagination_wrapper_padding', [ 'label' => esc_html__( 'Wrapper Padding', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'default' => [ 'top' => 0, 'right' => 0, 'bottom' => 0, 'left' => 0, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'pagination_radius', [ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => 3, 'right' => 3, 'bottom' => 3, 'left' => 3, ], 'selectors' => [ '{{WRAPPER}} .wpr-grid-pagination a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination > div > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .wpr-grid-pagination span.wpr-grid-current-page' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } // Get Taxonomies Related to Post Type public function get_related_taxonomies() { $relations = []; $post_types = Utilities::get_custom_types_of( 'post', false ); foreach ( $post_types as $slug => $title ) { $relations[$slug] = []; foreach ( get_object_taxonomies( $slug ) as $tax ) { array_push( $relations[$slug], $tax ); } } return json_encode( $relations ); } // Get Max Pages public function get_max_num_pages( $settings ) { $query = new \WP_Query( $this->get_main_query_args() ); $max_num_pages = intval( ceil( $query->max_num_pages ) ); // Reset wp_reset_postdata(); // $max_num_pages return $max_num_pages; } // Main Query Args public function get_main_query_args() { $settings = $this->get_settings_for_display(); $author = ! empty( $settings[ 'query_author' ] ) ? implode( ',', $settings[ 'query_author' ] ) : ''; // Get Paged if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); } else { $paged = 1; } if ( empty($settings['query_offset']) ) { $settings[ 'query_offset' ] = 0; } $offset = ( $paged - 1 ) * $settings['query_posts_per_page'] + $settings[ 'query_offset' ]; if ( ! wpr_fs()->can_use_premium_code() ) { $settings[ 'query_randomize' ] = ''; $settings['order_posts'] = 'date'; } $query_order_by = '' != $settings['query_randomize'] ? $settings['query_randomize'] : $settings['order_posts']; if ( 'manual' === $settings[ 'query_selection' ] ) { $query_order_by = 'post__in'; } // Dynamic $args = [ 'post_type' => 'attachment', 'post_status' => 'inherit', 'tax_query' => $this->get_tax_query_args(), 'post__not_in' => $settings[ 'query_exclude_attachment' ], 'posts_per_page' => $settings['query_posts_per_page'], 'orderby' => $query_order_by, 'author' => $author, 'paged' => $paged, 'offset' => $offset ]; // Manual if ( 'manual' === $settings[ 'query_selection' ] ) { $post_ids = ['']; $attachments = $settings['query_manual_attachment']; $attachments_count = 0; if (!empty($attachments) ) { $attachments_count = count($attachments); } for ( $i = 0; $i < $attachments_count; $i++ ) { array_push( $post_ids, $settings['query_manual_attachment'][$i]['id'] ); } $orderby = '' === $settings[ 'query_randomize' ] ? 'post__in' : 'rand'; $args = [ 'post_type' => 'attachment', 'post_status' => 'inherit', 'post__in' => $post_ids, 'orderby' => $orderby, 'paged' => $paged, 'posts_per_page' => $settings['query_posts_per_page'], 'paged' => $paged, ]; } if ( 'rand' !== $query_order_by && 'manual' !== $settings['query_selection'] ) { $args['order'] = $settings['order_direction']; } return $args; } // Taxonomy Query Args public function get_tax_query_args() { $settings = $this->get_settings(); $tax_query = []; foreach ( get_object_taxonomies( 'attachment' ) as $tax ) { if ( ! empty($settings[ 'query_taxonomy_'. $tax ]) ) { array_push( $tax_query, [ 'taxonomy' => $tax, 'field' => 'id', 'terms' => $settings[ 'query_taxonomy_'. $tax ] ] ); } } return $tax_query; } // Get Animation Class public function get_animation_class( $data, $object ) { $class = ''; // Animation Class if ( 'none' !== $data[ $object .'_animation'] ) { $class .= ' wpr-'. $object .'-'. $data[ $object .'_animation']; $class .= ' wpr-anim-size-'. $data[ $object .'_animation_size']; $class .= ' wpr-anim-timing-'. $data[ $object .'_animation_timing']; if ( 'yes' === $data[ $object .'_animation_tr'] ) { $class .= ' wpr-anim-transparency'; } } return $class; } // Get Image Effect Class public function get_image_effect_class( $settings ) { $class = ''; if ( ! wpr_fs()->can_use_premium_code() ) { if ( 'pro-zi' == $settings['image_effects'] || 'pro-zo' == $settings['image_effects'] || 'pro-go' == $settings['image_effects'] || 'pro-bo' == $settings['image_effects'] ) { $settings['image_effects'] = 'none'; } } // Animation Class if ( 'none' !== $settings['image_effects'] ) { $class .= ' wpr-'. $settings['image_effects']; } // Slide Effect if ( 'slide' !== $settings['image_effects'] ) { $class .= ' wpr-effect-size-'. $settings['image_effects_size']; } else { $class .= ' wpr-effect-dir-'. $settings['image_effects_direction']; } return $class; } // Render Post Thumbnail public function render_post_thumbnail( $settings ) { $id = get_the_ID(); $src = Group_Control_Image_Size::get_attachment_image_src( $id, 'layout_image_crop', $settings ); $alt = '' === wp_get_attachment_caption( $id ) ? get_the_title() : wp_get_attachment_caption( $id ); echo '
'; echo ''. esc_attr( $alt ) .''; echo '
'; } // Render Media Overlay public function render_media_overlay( $settings ) { echo '
'; if ( wpr_fs()->can_use_premium_code() ) { if ( '' !== $settings['overlay_image']['url'] ) { echo ''; } } echo '
'; } // Render Post Title public function render_post_title( $settings, $class ) { $title_pointer = ! wpr_fs()->can_use_premium_code() ? 'none' : $this->get_settings()['title_pointer']; $title_pointer_animation = ! wpr_fs()->can_use_premium_code() ? 'fade' : $this->get_settings()['title_pointer_animation']; $pointer_item_class = (isset($this->get_settings()['title_pointer']) && 'none' !== $this->get_settings()['title_pointer']) ? 'class="wpr-pointer-item"' : ''; $class .= ' wpr-pointer-'. $title_pointer; $class .= ' wpr-pointer-line-fx wpr-pointer-fx-'. $title_pointer_animation; $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p']; $element_title_tag = Utilities::validate_html_tags_wl( $settings['element_title_tag'], 'h2', $tags_whitelist ); echo '<'. esc_attr($element_title_tag) .' class="'. esc_attr($class) .'">'; echo '
'; echo ''; echo esc_html(wp_trim_words( get_the_title(), $settings['element_word_count'] )); echo ''; echo '
'; echo ''; } // Render Post Excerpt public function render_post_excerpt( $settings, $class ) { $dropcap_class = 'yes' === $settings['element_dropcap'] ? ' wpr-enable-dropcap' : ''; $class .= $dropcap_class; if ( '' === get_the_excerpt() ) { return; } echo '
'; echo '
'; echo '

'. esc_html(wp_trim_words( get_the_excerpt(), $settings['element_word_count'] )) .'

'; echo '
'; echo '
'; } // Render Post Date public function render_post_date( $settings, $class ) { echo '
'; echo '
'; echo ''; // Text: Before if ( 'before' === $settings['element_extra_text_pos'] ) { echo ''. esc_html( $settings['element_extra_text'] ) .''; } // Icon: Before if ( 'before' === $settings['element_extra_icon_pos'] ) { ob_start(); \Elementor\Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); $extra_icon = ob_get_clean(); echo ''; echo $extra_icon; echo ''; } // Date echo esc_html(apply_filters( 'the_date', get_the_date( '' ), get_option( 'date_format' ), '', '' )); // Icon: After if ( 'after' === $settings['element_extra_icon_pos'] ) { ob_start(); \Elementor\Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); $extra_icon = ob_get_clean(); echo ''; echo $extra_icon; echo ''; } // Text: After if ( 'after' === $settings['element_extra_text_pos'] ) { echo ''. esc_html( $settings['element_extra_text'] ) .''; } echo ''; echo '
'; echo '
'; } // Render Post Time public function render_post_time( $settings, $class ) { echo '
'; echo '
'; echo ''; // Text: Before if ( 'before' === $settings['element_extra_text_pos'] ) { echo ''. esc_html( $settings['element_extra_text'] ) .''; } // Icon: Before if ( 'before' === $settings['element_extra_icon_pos'] ) { ob_start(); \Elementor\Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); $extra_icon = ob_get_clean(); echo ''; echo $extra_icon; echo ''; } // Time echo esc_html(get_the_time('')); // Icon: After if ( 'after' === $settings['element_extra_icon_pos'] ) { ob_start(); \Elementor\Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']); $extra_icon = ob_get_clean(); echo ''; echo $extra_icon; echo ''; } // Text: After if ( 'after' === $settings['element_extra_text_pos'] ) { echo ''. esc_html( $settings['element_extra_text'] ) .''; } echo ''; echo '
'; echo '
'; } // Render Post Author public function render_post_author( $settings, $class ) { $author_id = get_post_field( 'post_author' ); echo '
'; echo ''; echo '
'; } // Render Post Likes public function render_post_likes( $settings, $class, $post_id ) {} // Render Post Sharing public function render_post_sharing_icons( $settings, $class ) {} // Render Post Lightbox public function render_post_lightbox( $settings, $class, $post_id ) { echo '
'; echo '
'; $lightbox_source = get_the_post_thumbnail_url( $post_id ); // Audio Post Type if ( 'audio' === get_post_format() ) { // Load Meta Value if ( 'meta' === $settings['element_lightbox_pfa_select'] ) { $utilities = new Utilities(); $meta_value = get_post_meta( $post_id, $settings['element_lightbox_pfa_meta'], true ); // URL if ( false === strpos( $meta_value, '