'condition' => [
'pagination_type' => 'numbered',
'pagination_prev_next' => 'yes',
],
]
);
$this->add_control(
'pagination_next_text',
[
'label' => esc_html__( 'Next Page Text', 'wpr-addons' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => 'Next Page',
'condition' => [
'pagination_type' => 'numbered',
'pagination_prev_next' => 'yes',
]
]
);
$this->add_control(
'pagination_pn_icon',
[
'label' => esc_html__( 'Select Icon', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'fas fa-angle',
'options' => Utilities::get_svg_icons_array( 'arrows', [
'fas fa-angle' => esc_html__( 'Angle', 'wpr-addons' ),
'fas fa-angle-double' => esc_html__( 'Angle Double', 'wpr-addons' ),
'fas fa-arrow' => esc_html__( 'Arrow', 'wpr-addons' ),
'fas fa-arrow-alt-circle' => esc_html__( 'Arrow Circle', 'wpr-addons' ),
'far fa-arrow-alt-circle' => esc_html__( 'Arrow Circle Alt', 'wpr-addons' ),
'fas fa-long-arrow-alt' => esc_html__( 'Long Arrow', 'wpr-addons' ),
'fas fa-chevron' => esc_html__( 'Chevron', 'wpr-addons' ),
'svg-icons' => esc_html__( 'SVG Icons -----', 'wpr-addons' ),
] ),
'condition' => [
'pagination_type' => 'numbered',
'pagination_prev_next' => 'yes'
],
]
);
$this->add_control(
'pagination_first_last',
[
'label' => esc_html__( 'First & Last Buttons', 'wpr-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'return_value' => 'yes',
'condition' => [
'pagination_type' => 'numbered',
],
]
);
$this->add_control(
'pagination_first_text',
[
'label' => esc_html__( 'First Page Text', 'wpr-addons' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => 'First Page',
'condition' => [
'pagination_type' => 'numbered',
'pagination_first_last' => 'yes',
],
]
);
$this->add_control(
'pagination_last_text',
[
'label' => esc_html__( 'Last Page Text', 'wpr-addons' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => 'Last Page',
'condition' => [
'pagination_type' => 'numbered',
'pagination_first_last' => 'yes',
]
]
);
$this->add_control(
'pagination_fl_icon',
[
'label' => esc_html__( 'Select Icon', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'fas fa-angle-double',
'options' => Utilities::get_svg_icons_array( 'arrows', [
'fas fa-angle' => esc_html__( 'Angle', 'wpr-addons' ),
'fas fa-angle-double' => esc_html__( 'Angle Double', 'wpr-addons' ),
'fas fa-arrow' => esc_html__( 'Arrow', 'wpr-addons' ),
'fas fa-arrow-alt-circle' => esc_html__( 'Arrow Circle', 'wpr-addons' ),
'far fa-arrow-alt-circle' => esc_html__( 'Arrow Circle Alt', 'wpr-addons' ),
'fas fa-long-arrow-alt' => esc_html__( 'Long Arrow', 'wpr-addons' ),
'fas fa-chevron' => esc_html__( 'Chevron', 'wpr-addons' ),
'svg-icons' => esc_html__( 'SVG Icons -----', 'wpr-addons' ),
] ),
'condition' => [
'pagination_type' => 'numbered',
'pagination_first_last' => 'yes'
],
]
);
$this->add_control(
'pagination_disabled_arrows',
[
'label' => esc_html__( 'Show Disabled Buttons', 'wpr-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'return_value' => 'yes',
'condition' => [
'pagination_type' => [ 'default', 'numbered' ],
],
]
);
$this->add_control(
'pagination_range',
[
'label' => esc_html__( 'Range', 'wpr-addons' ),
'type' => Controls_Manager::NUMBER,
'default' => 2,
'min' => 1,
'condition' => [
'pagination_type' => 'numbered',
]
]
);
$this->add_control(
'pagination_load_more_text',
[
'label' => esc_html__( 'Load More Text', 'wpr-addons' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => 'Load More',
'condition' => [
'pagination_type' => 'load-more',
]
]
);
$this->add_control(
'pagination_finish_text',
[
'label' => esc_html__( 'Finish Text', 'wpr-addons' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => 'End of Content.',
'condition' => [
'pagination_type' => [ 'load-more', 'infinite-scroll' ],
]
]
);
$this->add_control(
'pagination_animation',
[
'label' => esc_html__( 'Select Animation', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'loader-1',
'options' => [
'none' => esc_html__( 'None', 'wpr-addons' ),
'loader-1' => esc_html__( 'Loader 1', 'wpr-addons' ),
'loader-2' => esc_html__( 'Loader 2', 'wpr-addons' ),
'loader-3' => esc_html__( 'Loader 3', 'wpr-addons' ),
'loader-4' => esc_html__( 'Loader 4', 'wpr-addons' ),
'loader-5' => esc_html__( 'Loader 5', 'wpr-addons' ),
'loader-6' => esc_html__( 'Loader 6', 'wpr-addons' ),
],
'condition' => [
'pagination_type' => [ 'load-more', 'infinite-scroll' ],
]
]
);
$this->add_control(
'pagination_align',
[
'label' => esc_html__( 'Alignment', 'wpr-addons' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'wpr-addons' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'wpr-addons' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'wpr-addons' ),
'icon' => 'eicon-text-align-right',
],
'justify' => [
'title' => esc_html__( 'Justified', 'wpr-addons' ),
'icon' => 'eicon-text-align-justify',
],
],
'default' => 'center',
'prefix_class' => 'wpr-grid-pagination-',
'render_type' => 'template',
'separator' => 'before',
'condition' => [
'pagination_type!' => 'infinite-scroll',
]
]
);
$this->end_controls_section(); // End Controls Section
// Section: Request New Feature
Utilities::wpr_add_section_request_feature( $this, Controls_Manager::RAW_HTML, '' );
// Section: Pro Features
Utilities::pro_features_list_section( $this, '', Controls_Manager::RAW_HTML, 'grid', [
'Grid Columns 1,2,3,4,5,6',
'Masonry Layout',
'List Layout Zig-zag',
'Posts Slider Columns (Carousel) 1,2,3,4,5,6',
'Secondary Featured Image',
'Related Posts Query, Current Page Query, Random Posts Query',
'Infinite Scrolling Pagination',
'Post Slider Autoplay options',
'Post Slider Advanced Navigation Positioning',
'Post Slider Advanced Pagination Positioning',
'Advanced Post Likes',
'Advanced Post Sharing',
'Advanced Grid Loading Animations (Fade in & Slide Up)',
'Advanced Grid Elements Positioning',
'Unlimited Image Overlay Animations',
'Image overlay GIF upload option',
'Image Overlay Blend Mode',
'Image Effects: Zoom, Grayscale, Blur',
'Lightbox Thumbnail Gallery, Lightbox Image Sharing Button',
'Grid Category Filter Deeplinking',
'Grid Category Filter Icons select',
'Grid Category Filter Count',
'Grid Item Even/Odd Background Color',
'Title, Category, Read More Advanced Link Hover Animations',
'Display Scheduled Posts',
'Open Links in New Tab',
'Lazy Loading',
'Posts Order',
'Trim Title & Excerpt By Letter Count',
'Custom Fields Support (Expert)',
'Custom Post Types Support (Expert)',
] );
// Styles ====================
// Section: Grid Item --------
$this->start_controls_section(
'section_style_grid_item',
[
'label' => esc_html__( 'Grid Item', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
// TEMPORARY - GOGA
// $this->add_control(
// 'apply_styling_to_media_wrap',
// [
// 'label' => esc_html__( 'Apply Styles To Media', 'wpr-addons' ),
// 'type' => Controls_Manager::SWITCHER,
// ]
// );
// $this->add_control(
// 'grid_item_outer_bg_color',
// [
// 'label' => esc_html__( 'Background Color', 'wpr-addons' ),
// 'type' => Controls_Manager::COLOR,
// 'default' => '',
// 'selectors' => [
// '{{WRAPPER}} .wpr-grid-item' => 'background-color: {{VALUE}}',
// ],
// 'condition' => [
// 'apply_styling_to_media_wrap' => 'yes'
// ]
// ]
// );
// $this->add_responsive_control(
// 'grid_item_outer_padding',
// [
// 'label' => esc_html__( 'Padding', 'wpr-addons' ),
// 'type' => Controls_Manager::DIMENSIONS,
// 'size_units' => [ 'px' ],
// 'default' => [
// 'top' => 10,
// 'right' => 0,
// 'bottom' => 0,
// 'left' => 0,
// ],
// 'selectors' => [
// '{{WRAPPER}} .wpr-grid-media-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
// ],
// 'condition' => [
// 'apply_styling_to_media_wrap' => 'yes'
// ],
// 'render_type' => 'template'
// ]
// );
$this->add_control(
'grid_item_styles_selector',
[
'label' => esc_html__( 'Apply Styles To', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
'inner' => esc_html__( 'Inner Elements', 'wpr-addons' ),
'wrapper' => esc_html__( 'Wrapper', 'wpr-addons' )
],
'default' => 'inner',
'prefix_class' => 'wpr-item-styles-',
'render_type' => 'template'
]
);
$this->add_control(
'grid_item_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-above-content' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-item-below-content' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid[data-settings*="fitRows"] .wpr-grid-item' => 'background-color: {{VALUE}}',
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'background-color: {{VALUE}}'
],
]
);
$this->add_control_grid_item_even_bg_color();
$this->add_control(
'grid_item_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}}.wpr-item-styles-inner .wpr-grid-item-above-content' => 'border-color: {{VALUE}}',
'{{WRAPPER}}.wpr-item-styles-inner .wpr-grid-item-below-content' => 'border-color: {{VALUE}}',
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'border-color: {{VALUE}}'
],
]
);
$this->add_control_grid_item_even_border_color();
$this->add_control(
'grid_item_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-item-styles-inner .wpr-grid-item-above-content' => 'border-style: {{VALUE}};',
'{{WRAPPER}}.wpr-item-styles-inner .wpr-grid-item-below-content' => 'border-style: {{VALUE}};',
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'border-style: {{VALUE}}'
],
'separator' => 'before',
]
);
$this->add_control(
'grid_item_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-item-styles-inner .wpr-grid-item-above-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}}.wpr-item-styles-inner .wpr-grid-item-below-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
],
'condition' => [
'grid_item_border_type!' => 'none',
],
'render_type' => 'template'
]
);
$this->add_responsive_control(
'grid_item_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 10,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-above-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-below-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
],
'condition' => [
'grid_item_styles_selector' => 'inner'
],
'render_type' => 'template'
]
);
// GOGA - maybe better to set separate padding control
$this->add_responsive_control(
'grid_item_wrap_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 10,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}}.wpr-item-styles-wrapper .wpr-grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
],
'condition' => [
'grid_item_styles_selector' => 'wrapper'
],
'render_type' => 'template'
]
);
$this->add_control(
'grid_item_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-above-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-below-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'grid_item_shadow',
'selector' => '{{WRAPPER}} .wpr-grid-item',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Grid Media -------
$this->start_controls_section(
'section_style_grid_media',
[
'label' => esc_html__( 'Grid Media', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'grid_media_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-image-wrap' => 'border-color: {{VALUE}}',
]
]
);
$this->add_control(
'grid_media_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-image-wrap' => 'border-style: {{VALUE}};',
]
]
);
$this->add_control(
'grid_media_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-image-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'grid_media_border_type!' => 'none',
],
]
);
$this->add_control(
'grid_media_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Media Overlay ----
$this->start_controls_section(
'section_style_overlay',
[
'label' => esc_html__( 'Media Overlay', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control_overlay_color();
$this->add_control_overlay_blend_mode();
$this->add_control_overlay_border_color();
$this->add_control_overlay_border_type();
$this->add_control_overlay_border_width();
$this->add_control(
'overlay_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-media-hover-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Title ------------
$this->start_controls_section(
'section_style_title',
[
'label' => esc_html__( 'Title', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_title_style' );
$this->start_controls_tab(
'tab_grid_title_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#333333',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'title_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'title_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_title_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'title_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#54595f',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'title_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'title_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a:hover' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control_title_pointer_color_hr();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control_title_pointer();
$this->add_control_title_pointer_height();
$this->add_control_title_pointer_animation();
$this->add_control(
'title_transition_duration',
[
'label' => esc_html__( 'Transition Duration', 'wpr-addons' ),
'type' => Controls_Manager::NUMBER,
'default' => 0.2,
'min' => 0,
'max' => 5,
'step' => 0.1,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-item-title .wpr-pointer-item:before' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-item-title .wpr-pointer-item:after' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-title a'
]
);
$this->add_control(
'title_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-item-title .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'title_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-item-title .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'title_border_type!' => 'none',
],
]
);
$this->add_responsive_control(
'title_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-title .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Content ----------
$this->start_controls_section(
'section_style_content',
[
'label' => esc_html__( 'Content', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'content_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#6A6A6A',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'content_dropcap_color',
[
'label' => esc_html__( 'DropCap Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#3a3a3a',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content.wpr-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'content_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'content_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'content_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-content'
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'content_dropcap_typography',
'label' => esc_html__( 'Drop Cap Typography', 'wpr-addons' ),
'selector' => '{{WRAPPER}} .wpr-grid-item-content.wpr-enable-dropcap p:first-child:first-letter'
]
);
$this->add_responsive_control(
'content_justify',
[
'label' => esc_html__( 'Justify Text', 'wpr-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'widescreen_default' => '',
'laptop_default' => '',
'tablet_extra_default' => '',
'tablet_default' => '',
'mobile_extra_default' => '',
'mobile_default' => '',
'selectors_dictionary' => [
'' => '',
'yes' => 'text-align: justify;'
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => '{{VALUE}}',
],
'render_type' => 'template',
]
);
$this->add_control(
'content_width',
[
'label' => esc_html__( 'Content Width', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['%'],
'range' => [
'%' => [
'min' => 10,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 100,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'width: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'content_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-item-content .inner-block' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'content_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-item-content .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'content_border_type!' => 'none',
],
]
);
$this->add_responsive_control(
'content_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'content_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-content .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
// Styles ====================
// Section: Excerpt ----------
$this->start_controls_section(
'section_style_excerpt',
[
'label' => esc_html__( 'Excerpt', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'excerpt_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#6A6A6A',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'excerpt_dropcap_color',
[
'label' => esc_html__( 'DropCap Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#3a3a3a',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt.wpr-enable-dropcap p:first-child:first-letter' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'excerpt_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'excerpt_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'excerpt_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-excerpt'
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'excerpt_dropcap_typography',
'label' => esc_html__( 'Drop Cap Typography', 'wpr-addons' ),
'selector' => '{{WRAPPER}} .wpr-grid-item-excerpt.wpr-enable-dropcap p:first-child:first-letter'
]
);
$this->add_responsive_control(
'excerpt_justify',
[
'label' => esc_html__( 'Justify Text', 'wpr-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'widescreen_default' => '',
'laptop_default' => '',
'tablet_extra_default' => '',
'tablet_default' => '',
'mobile_extra_default' => '',
'mobile_default' => '',
'selectors_dictionary' => [
'' => '',
'yes' => 'text-align: justify;'
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => '{{VALUE}}',
],
'render_type' => 'template',
]
);
$this->add_control(
'excerpt_width',
[
'label' => esc_html__( 'Excerpt Width', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['%'],
'range' => [
'%' => [
'min' => 10,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 100,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'width: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'excerpt_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-item-excerpt .inner-block' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'excerpt_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-item-excerpt .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'excerpt_border_type!' => 'none',
],
]
);
$this->add_responsive_control(
'excerpt_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'excerpt_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-excerpt .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
// Styles ====================
// Section: Date -------------
$this->start_controls_section(
'section_style_date',
[
'label' => esc_html__( 'Date', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'date_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'date_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block > span' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'date_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block > span' => 'border-color: {{VALUE}}',
]
]
);
$this->add_control(
'date_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'date_extra_icon_color',
[
'label' => esc_html__( 'Extra Icon Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block [class*="wpr-grid-extra-icon"] i' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-item-date .inner-block [class*="wpr-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'date_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-date, {{WRAPPER}} .wpr-grid-item-date span'
]
);
$this->add_control(
'date_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-item-date .inner-block > span' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'date_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-item-date .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'date_border_type!' => 'none',
],
]
);
$this->add_control(
'date_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-date .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'date_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-date .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'date_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'date_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 7,
'bottom' => 0,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-date .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
// Styles ====================
// Section: Time -------------
$this->start_controls_section(
'section_style_time',
[
'label' => esc_html__( 'Time', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'time_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'time_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block > span' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'time_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block > span' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'time_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'time_extra_icon_color',
[
'label' => esc_html__( 'Extra Icon Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block [class*="wpr-grid-extra-icon"] i' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-item-time .inner-block [class*="wpr-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'time_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-time'
]
);
$this->add_control(
'time_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-item-time .inner-block > span' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'time_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-item-time .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'time_border_type!' => 'none',
],
]
);
$this->add_control(
'time_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-time .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'time_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-time .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'time_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'time_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-time .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Author -----------
$this->start_controls_section(
'section_style_author',
[
'label' => esc_html__( 'Author', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_author_style' );
$this->start_controls_tab(
'tab_grid_author_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'author_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'author_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'author_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'author_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_author_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'author_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'author_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'author_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a:hover' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'author_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-item-author .inner-block a' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'author_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-author, {{WRAPPER}} .wpr-grid-item-author .inner-block a'
]
);
$this->add_control(
'author_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-item-author .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'author_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-item-author .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'author_border_type!' => 'none',
],
]
);
$this->add_control(
'author_border_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_control(
'author_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-author .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'author_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-author .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'author_avatar_spacing',
[
'label' => esc_html__( 'Avatar Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author img' => 'margin-right: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'author_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'author_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-author .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
// Styles ====================
// Section: Comments ---------
$this->start_controls_section(
'section_style_comments',
[
'label' => esc_html__( 'Comments', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_comments_style' );
$this->start_controls_tab(
'tab_grid_comments_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'comments_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'comments_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'comments_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'comments_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_comments_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'comments_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'comments_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'comments_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a:hover' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'comments_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-item-comments .inner-block a' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'comments_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-comments'
]
);
$this->add_control(
'comments_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-item-comments .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'comments_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-item-comments .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'comments_border_type!' => 'none',
],
]
);
$this->add_control(
'comments_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-comments .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->add_control(
'comments_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-comments .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'comments_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'comments_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'comments_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 2,
'right' => 2,
'bottom' => 2,
'left' => 2,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-comments .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Read More --------
$this->start_controls_section(
'section_style_read_more',
[
'label' => esc_html__( 'Read More', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_read_more_style' );
$this->start_controls_tab(
'tab_grid_read_more_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'read_more_bg_color',
'label' => esc_html__( 'Background', 'wpr-addons' ),
'types' => [ 'classic', 'gradient' ],
'fields_options' => [
'color' => [
'default' => '#434900',
],
],
'selector' => '{{WRAPPER}} .wpr-grid-item-read-more .inner-block a'
]
);
$this->add_control(
'read_more_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'read_more_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a' => 'border-color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'read_more_box_shadow',
'selector' => '{{WRAPPER}} .wpr-grid-item-read-more .inner-block a',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_read_more_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'read_more_bg_color_hr',
'label' => esc_html__( 'Background', 'wpr-addons' ),
'types' => [ 'classic', 'gradient' ],
'fields_options' => [
'color' => [
'default' => '#434900',
],
],
'selector' => '{{WRAPPER}} .wpr-grid-item-read-more .inner-block a.wpr-button-none:hover, {{WRAPPER}} .wpr-grid-item-read-more .inner-block a:before, {{WRAPPER}} .wpr-grid-item-read-more .inner-block a:after'
]
);
$this->add_control(
'read_more_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#4A45D2',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'read_more_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a:hover' => 'border-color: {{VALUE}}',
]
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'read_more_box_shadow_hr',
'selector' => '{{WRAPPER}} .wpr-grid-item-read-more .inner-block :hover a',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'read_more_divider',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->add_control_read_more_animation();
$this->add_control(
'read_more_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-item-read-more .inner-block a' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a:before' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a:after' => 'transition-duration: {{VALUE}}s',
],
]
);
$this->add_control_read_more_animation_height();
$this->add_control(
'read_more_typo_divider',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'read_more_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-read-more a'
]
);
$this->add_control(
'read_more_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-item-read-more .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'read_more_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-item-read-more .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'read_more_border_type!' => 'none',
],
]
);
$this->add_control(
'read_more_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-read-more .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->add_responsive_control(
'read_more_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'read_more_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'read_more_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-read-more .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles =======================
// Section: Likes ---------------
$this->add_section_style_likes();
// Styles =========================
// Section: Sharing ---------------
$this->add_section_style_sharing();
// Styles ====================
// Section: Lightbox ---------
$this->start_controls_section(
'section_style_lightbox',
[
'label' => esc_html__( 'Lightbox', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_lightbox_style' );
$this->start_controls_tab(
'tab_grid_lightbox_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'lightbox_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'lightbox_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'lightbox_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span' => 'border-color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'lightbox_shadow',
'selector' => '{{WRAPPER}} .wpr-grid-item-lightbox i',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_lightbox_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'lightbox_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'lightbox_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'lightbox_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span:hover' => 'border-color: {{VALUE}}',
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'lightbox_shadow_divider',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->add_control(
'lightbox_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-item-lightbox .inner-block > span' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'lightbox_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-lightbox'
]
);
$this->add_control(
'lightbox_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-item-lightbox .inner-block > span' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'lightbox_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-item-lightbox .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'lightbox_border_type!' => 'none',
],
]
);
$this->add_control(
'lightbox_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-item-lightbox .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before'
]
);
$this->add_responsive_control(
'lightbox_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'lightbox_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'lightbox_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 2,
'right' => 2,
'bottom' => 2,
'left' => 2,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-lightbox .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->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-grid-filters .wpr-pointer-item:before' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-filters .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',
],
]
);
$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}}',
'{{WRAPPER}} .wpr-ring div' => 'border-color: {{VALUE}} transparent transparent transparent',
],
'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, {{WRAPPER}} .wpr-grid-pagination a'
]
);
$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-grid-current-page' => '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}};',
],
'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' => 25,
],
'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 a:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-pagination > div > span' => 'margin-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-pagination > div > a.wpr-prev-page' => 'margin-right: {{SIZE}}{{UNIT}};',
// '{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow' => 'margin-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-pagination span.wpr-disabled-arrow:not(:last-child)' => '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' => 20,
'bottom' => 8,
'left' => 20,
],
'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();
// Styles ====================
// Section: Password Protected
$this->start_controls_section(
'section_style_pwd_protected',
[
'label' => esc_html__( 'Password Protected', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'pwd_protected_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-protected' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'pwd_protected_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-protected' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'pwd_protected_input_color',
[
'label' => esc_html__( 'Input Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpr-grid-item-protected input' => 'background-color: {{VALUE}}',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'pwd_protected_typography',
'selector' => '{{WRAPPER}} .wpr-grid-item-protected p'
]
);
$this->end_controls_section();
// Styles ====================
// Section: Separator Style 1
$this->start_controls_section(
'section_style_separator1',
[
'label' => esc_html__( 'Separator Style 1', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'separator1_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
],
]
);
$this->add_control(
'separator1_width',
[
'label' => esc_html__( 'Width', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px','%'],
'range' => [
'px' => [
'min' => 0,
'max' => 300,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 100,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1:not(.wpr-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-sep-style-1.wpr-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'separator1_height',
[
'label' => esc_html__( 'Height', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 1,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 2,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'separator1_border_type',
[
'label' => esc_html__( 'Type', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
'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' => 'solid',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'separator1_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 15,
'right' => 0,
'bottom' => 15,
'left' => 0,
],
'render_type' => 'template',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'separator1_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-1 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Separator Style 2
$this->start_controls_section(
'section_style_separator2',
[
'label' => esc_html__( 'Separator Style 2', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->add_control(
'separator2_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
],
]
);
$this->add_control(
'separator2_width',
[
'label' => esc_html__( 'Width', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px','%'],
'range' => [
'px' => [
'min' => 0,
'max' => 300,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 20,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2:not(.wpr-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-sep-style-2.wpr-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'separator2_height',
[
'label' => esc_html__( 'Height', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 2,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'separator2_border_type',
[
'label' => esc_html__( 'Type', 'wpr-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
'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' => 'solid',
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'separator2_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 15,
'right' => 0,
'bottom' => 15,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'separator2_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-sep-style-2 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Taxonomy Style 1 ------
$this->start_controls_section(
'section_style_tax1',
[
'label' => esc_html__( 'Taxonomy Style 1', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_tax1_style' );
$this->start_controls_tab(
'tab_grid_tax1_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'tax1_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'tax1_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'tax1_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'tax1_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'tax1_extra_icon_color',
[
'label' => esc_html__( 'Extra Icon Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block [class*="wpr-grid-extra-icon"] i' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block [class*="wpr-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
],
'separator' => 'after',
]
);
$this->add_control_tax1_custom_colors($tax_meta_keys[1]);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_tax1_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'tax1_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-pointer-item:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-pointer-item:after' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'tax1_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'tax1_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a:hover' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control_tax1_pointer_color_hr();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control_tax1_pointer();
$this->add_control_tax1_pointer_height();
$this->add_control_tax1_pointer_animation();
$this->add_control(
'tax1_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-tax-style-1 .inner-block a' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-pointer-item:before' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-pointer-item:after' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'tax1_typography',
'selector' => '{{WRAPPER}} .wpr-grid-tax-style-1'
]
);
$this->add_control(
'tax1_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-tax-style-1 .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'tax1_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-tax-style-1 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'tax1_border_type!' => 'none',
],
]
);
$this->add_control(
'tax1_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'tax1_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-tax-style-1 .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'tax1_gutter',
[
'label' => esc_html__( 'Gutter', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 20,
],
],
'default' => [
'unit' => 'px',
'size' => 3,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'tax1_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_responsive_control(
'tax1_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'tax1_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-1 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles ====================
// Section: Taxonomy Style 2 -
$this->start_controls_section(
'section_style_tax2',
[
'label' => esc_html__( 'Taxonomy Style 2', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
]
);
$this->start_controls_tabs( 'tabs_grid_tax2_style' );
$this->start_controls_tab(
'tab_grid_tax2_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'tax2_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'tax2_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'tax2_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control(
'tax2_extra_text_color',
[
'label' => esc_html__( 'Extra Text Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block span[class*="wpr-grid-extra-text"]' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'tax2_extra_icon_color',
[
'label' => esc_html__( 'Extra Icon Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#9C9C9C',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block [class*="wpr-grid-extra-icon"] i' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block [class*="wpr-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
],
'separator' => 'after',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_tax2_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'tax2_color_hr',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-pointer-item:before' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-pointer-item:after' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'tax2_bg_color_hr',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#4A45D2',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a:hover' => 'background-color: {{VALUE}}',
]
]
);
$this->add_control(
'tax2_border_color_hr',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#E8E8E8',
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a:hover' => 'border-color: {{VALUE}}',
],
]
);
$this->add_control_tax2_pointer_color_hr();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control_tax2_pointer();
$this->add_control_tax2_pointer_height();
$this->add_control_tax2_pointer_animation();
$this->add_control(
'tax2_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-tax-style-2 .inner-block a' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-pointer-item:before' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-pointer-item:after' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'after',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'tax2_typography',
'selector' => '{{WRAPPER}} .wpr-grid-tax-style-2'
]
);
$this->add_control(
'tax2_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-tax-style-2 .inner-block a' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'tax2_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-tax-style-2 .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'tax2_border_type!' => 'none',
],
]
);
$this->add_control(
'tax2_text_spacing',
[
'label' => esc_html__( 'Extra Text Spacing', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 25,
],
],
'default' => [
'unit' => 'px',
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_control(
'tax2_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' => 5,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-tax-style-2 .wpr-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'tax2_gutter',
[
'label' => esc_html__( 'Gutter', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 20,
],
],
'default' => [
'unit' => 'px',
'size' => 3,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_responsive_control(
'tax2_padding',
[
'label' => esc_html__( 'Padding', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 10,
'bottom' => 0,
'left' => 10,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_responsive_control(
'tax2_margin',
[
'label' => esc_html__( 'Margin', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'default' => [
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-tax-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
]
);
$this->add_control(
'tax2_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-tax-style-2 .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->end_controls_section();
// Styles =======================
// Section: Custom Field Style 1
$this->add_section_style_custom_field1();
// Styles =======================
// Section: Custom Field Style 2
$this->add_section_style_custom_field2();
// Styles =======================
// Section: Custom Field Style 3
$this->add_section_style_custom_field3();
// Styles =======================
// Section: Custom Field Style 4
$this->add_section_style_custom_field4();
// Styles ====================
// Section: Navigation -------
$this->start_controls_section(
'wpr__section_style_grid_slider_nav',
[
'label' => esc_html__( 'Slider Navigation', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'layout_select' => 'slider',
],
]
);
$this->start_controls_tabs( 'tabs_grid_slider_nav_style' );
$this->start_controls_tab(
'tab_grid_slider_nav_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'grid_slider_nav_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'color: {{VALUE}};',
'{{WRAPPER}} .wpr-grid-slider-arrow svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_nav_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_nav_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => 'rgba(255,255,255,0.8)',
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'border-color: {{VALUE}};',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_slider_nav_hover',
[
'label' => esc_html__( 'Hover', 'wpr-addons' ),
]
);
$this->add_control(
'grid_slider_nav_hover_color',
[
'label' => esc_html__( 'Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#4A45D2',
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow:hover' => 'color: {{VALUE}};',
'{{WRAPPER}} .wpr-grid-slider-arrow:hover svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_nav_hover_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow:hover' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_nav_hover_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow:hover' => 'border-color: {{VALUE}};',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'grid_slider_nav_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-slider-arrow' => 'transition-duration: {{VALUE}}s',
'{{WRAPPER}} .wpr-grid-slider-arrow svg' => 'transition-duration: {{VALUE}}s',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'grid_slider_nav_font_size',
[
'label' => esc_html__( 'Font Size', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', ],
'range' => [
'px' => [
'min' => 10,
'max' => 200,
],
],
'default' => [
'unit' => 'px',
'size' => 25,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'font-size: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .wpr-grid-slider-arrow svg' => 'width: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'grid_slider_nav_size',
[
'label' => esc_html__( 'Box Size', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px',],
'range' => [
'px' => [
'min' => 10,
'max' => 200,
],
],
'default' => [
'unit' => 'px',
'size' => 60,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
],
'separator' => 'after',
]
);
$this->add_control(
'grid_slider_nav_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-slider-arrow' => 'border-style: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_nav_border_width',
[
'label' => esc_html__( 'Border Width', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => 2,
'right' => 2,
'bottom' => 2,
'left' => 2,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'grid_slider_nav_border_type!' => 'none',
],
]
);
$this->add_control(
'grid_slider_nav_border_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'after',
]
);
$this->add_control_stack_grid_slider_nav_position();
$this->end_controls_section(); // End Controls Section
// Styles ====================
// Section: Pagination -------
$this->start_controls_section(
'wpr__section_style_grid_slider_dots',
[
'label' => esc_html__( 'Slider Pagination', 'wpr-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'layout_select' => 'slider',
],
]
);
$this->start_controls_tabs( 'tabs_grid_slider_dots' );
$this->start_controls_tab(
'tab_grid_slider_dots_normal',
[
'label' => esc_html__( 'Normal', 'wpr-addons' ),
]
);
$this->add_control(
'grid_slider_dots_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => 'rgba(0,0,0,0.35)',
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dot' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'grid_slider_dots_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dot' => 'border-color: {{VALUE}}',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_grid_slider_dots_active',
[
'label' => esc_html__( 'Active', 'wpr-addons' ),
]
);
$this->add_control(
'grid_slider_dots_active_bg_color',
[
'label' => esc_html__( 'Background Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '#605BE5',
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dots .slick-active .wpr-grid-slider-dot' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'grid_slider_dots_active_border_color',
[
'label' => esc_html__( 'Border Color', 'wpr-addons' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dots .slick-active .wpr-grid-slider-dot' => 'border-color: {{VALUE}}',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'grid_slider_dots_width',
[
'label' => esc_html__( 'Box Width', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px',],
'range' => [
'px' => [
'min' => 1,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 8,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dot' => 'width: {{SIZE}}{{UNIT}};',
],
'separator' => 'before',
'render_type' => 'template'
]
);
$this->add_responsive_control(
'grid_slider_dots_height',
[
'label' => esc_html__( 'Box Height', 'wpr-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px',],
'range' => [
'px' => [
'min' => 1,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 8,
],
'selectors' => [
'{{WRAPPER}} .wpr-grid-slider-dot' => 'height: {{SIZE}}{{UNIT}};',
],
'render_type' => 'template'
]
);
$this->add_control(
'grid_slider_dots_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-slider-dot' => 'border-style: {{VALUE}};',
],
'render_type' => 'template',
'separator' => 'before',
]
);
$this->add_control(
'grid_slider_dots_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-slider-dot' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'render_type' => 'template',
'condition' => [
'grid_slider_dots_border_type!' => 'none',
],
]
);
$this->add_control(
'grid_slider_dots_border_radius',
[
'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'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
}
// 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();
$author = ! empty( $settings[ 'query_author' ] ) ? implode( ',', $settings[ 'query_author' ] ) : '';
// if ( is_user_logged_in() ){
// $logged_in_user = wp_get_current_user();
// $author = '1' . ',' . $logged_in_user->ID;
// }
// 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;
}
// Change Posts Per Page for Slider Layout
if ( 'slider' === $settings['layout_select'] && Utilities::is_new_free_user() ) {
$settings['query_posts_per_page'] = $settings['query_slides_to_show'] ? $settings['query_slides_to_show'] : -1;
$settings['query_posts_per_page'] = $settings['query_posts_per_page'] > 4 ? 4 : $settings['query_posts_per_page'];
}
if ( 'slider' === $settings['layout_select'] ) {
$paged = 1;
}
if ( empty($settings['query_offset']) ) {
$settings[ 'query_offset' ] = 0;
}
$offset = ( $paged - 1 ) * intval($settings['query_posts_per_page']) + intval($settings[ 'query_offset' ]);
if ( empty($settings['query_posts_per_page']) ) {
if ( !('slider' === $settings['layout_select'] && Utilities::is_new_free_user()) ) {
$settings['query_posts_per_page'] = 999;
}
}
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'];
$post__not_in = isset($settings[ 'query_exclude_'. $settings[ 'query_source' ] ]) && !empty($settings[ 'query_exclude_'. $settings[ 'query_source' ] ]) ? $settings[ 'query_exclude_'. $settings[ 'query_source' ] ] : [];
// Dynamic
$args = [
'post_type' => $settings[ 'query_source' ],
'tax_query' => $this->get_tax_query_args(),
'post__not_in' => $post__not_in,
'posts_per_page' => $settings['query_posts_per_page'],
'orderby' => $query_order_by,
'author' => $author,
'paged' => $paged,
'offset' => $offset
];
if ( $query_order_by == 'meta_value' ) {
$args['meta_key'] = $settings['order_posts_by_acf'];
}
// Display Scheduled Posts
if ( 'yes' === $settings['display_scheduled_posts'] && wpr_fs()->can_use_premium_code() ) {
$args['post_status'] = 'future';
} else {
$args['post_status'] = 'publish';
}
// Exclude Items without F/Image
if ( 'yes' === $settings['query_exclude_no_images'] ) {
$args['meta_key'] = '_thumbnail_id';
}
// Manual
if ( 'manual' === $settings[ 'query_selection' ] ) {
$post_ids = [''];
if ( ! empty($settings[ 'query_manual_'. $settings[ 'query_source' ] ]) ) {
$post_ids = $settings[ 'query_manual_'. $settings[ 'query_source' ] ];
}
$args = [
'post_type' => $settings[ 'query_source' ],
'post__in' => $post_ids,
'ignore_sticky_posts' => 1,
'posts_per_page' => $settings['query_posts_per_page'],
'orderby' => $query_order_by,
'paged' => $paged,
];
}
// Current
if ( 'current' === $settings[ 'query_source' ] ) {
global $wp_query;
$tax_query = [];
$args = $wp_query->query_vars;
if ( is_post_type_archive() ) {
$posts_per_page = intval(get_option('wpr_cpt_ppp_'. $args['post_type']), 10);
} else {
$posts_per_page = intval(get_option('posts_per_page'));
}
$args['orderby'] = $query_order_by;
$args['offset'] = ( $paged - 1 ) * $posts_per_page + intval($settings[ 'query_offset' ]);
if ( isset($_GET['category']) ) {
if ( $_GET['category'] != '0' ) {
// Get category from URL
$category = sanitize_text_field($_GET['category']);
array_push( $tax_query, [
'taxonomy' => 'category',
'field' => 'id',
'terms' => $category
] );
}
}
if ( isset($_GET['wpr_select_category']) ) {
if ( $_GET['wpr_select_category'] != '0' ) {
// Get category from URL
$category = sanitize_text_field($_GET['wpr_select_category']);
array_push( $tax_query, [
'taxonomy' => 'category',
'field' => 'id',
'terms' => $category
] );
}
}
if ( !empty($tax_query) ) {
$args['tax_query'] = $tax_query;
}
}
// Related
if ( 'related' === $settings[ 'query_source' ] ) {
$args = [
'post_type' => get_post_type( get_the_ID() ),
'tax_query' => $this->get_tax_query_args(),
'post__not_in' => [ get_the_ID() ],
'ignore_sticky_posts' => 1,
'posts_per_page' => $settings['query_posts_per_page'],
'orderby' => $query_order_by,
'offset' => $offset,
];
}
if ( 'rand' !== $query_order_by ) {
$args['order'] = $settings['order_direction'];
}
return $args;
}
// Taxonomy Query Args
public function get_tax_query_args() {
$settings = $this->get_settings();
$tax_query = [];
if ( 'related' === $settings[ 'query_source' ] ) {
$tax_query = [
[
'taxonomy' => $settings['query_tax_selection'],
'field' => 'term_id',
'terms' => wp_get_object_terms( get_the_ID(), $settings['query_tax_selection'], array( 'fields' => 'ids' ) ),
]
];
} else {
foreach ( get_object_taxonomies($settings[ 'query_source' ]) 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 = '';
// Disable Animation on Mobile
if ( 'overlay' !== $object ) {
if ( 'yes' === $data[$object .'_animation_disable_mobile'] && wp_is_mobile() ) {
return $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 Password Protected Input
public function render_password_protected_input( $settings ) {
if ( ! post_password_required() ) {
return;
}
add_filter( 'the_password_form', function () {
$output = '
';
return $output;
} );
echo '
';
echo '
';
echo '
';
echo get_the_password_form(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
';
echo '
';
echo '
';
}
// Render Post Thumbnail
public function render_post_thumbnail( $settings ) {
$id = get_post_thumbnail_id();
$src = Group_Control_Image_Size::get_attachment_image_src( $id, 'layout_image_crop', $settings );
if ( get_post_meta(get_the_ID(), 'wpr_secondary_image_id') && !empty(get_post_meta(get_the_ID(), 'wpr_secondary_image_id')) ) {
$src2 = Group_Control_Image_Size::get_attachment_image_src( get_post_meta(get_the_ID(), 'wpr_secondary_image_id')[0], 'layout_image_crop', $settings );
} else {
$src2 = '';
}
$alt = '' === wp_get_attachment_caption( $id ) ? get_the_title() : wp_get_attachment_caption( $id );
if ( has_post_thumbnail() ) {
echo '
';
if ( 'yes' == $settings['grid_lazy_loading'] ) {
echo '

';
if ( 'yes' == $settings['secondary_img_on_hover'] ) {
echo '
 . ')
';
}
} else {
echo '
 . ')
';
if ( 'yes' == $settings['secondary_img_on_hover'] ) {
echo '
 . ')
';
}
}
echo '
';
}
}
// Render Media Overlay
public function render_media_overlay( $settings ) {
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"' : '';
$open_links_in_new_tab = 'yes' === $this->get_settings()['open_links_in_new_tab'] ? '_blank' : '_self';
$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 ''. esc_attr($element_title_tag) .'>';
}
// Render Post Content
public function render_post_content( $settings, $class ) {
$dropcap_class = 'yes' === $settings['element_dropcap'] ? ' wpr-enable-dropcap' : '';
$class .= $dropcap_class;
if ( '' === get_the_content() ) {
return;
}
echo '
';
echo '
';
echo wp_kses_post(get_the_content());
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 '
';
if ( 'word_count' === $settings['element_trim_text_by']) {
echo '
'. esc_html(wp_trim_words( get_the_excerpt(), $settings['element_word_count'] )) .'
';
} else {
// echo '
'. substr(html_entity_decode(get_the_title()), 0, $settings['element_letter_count']) .'...' . '
';
echo '
'. esc_html(implode('', array_slice( str_split(get_the_excerpt()), 0, $settings['element_letter_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 '';
}
// 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 '';
}
// Date
if ( 'yes' === $settings['show_last_update_date'] ) {
echo esc_html(get_the_modified_time(get_option( 'date_format' )));
} else {
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 '';
}
// Text: After
if ( 'after' === $settings['element_extra_text_pos'] ) {
echo '';
}
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 '';
}
// 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 '';
}
// 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 '';
}
// Text: After
if ( 'after' === $settings['element_extra_text_pos'] ) {
echo '';
}
echo '';
echo '
';
echo '
';
}
// Render Post Author
public function render_post_author( $settings, $class ) {
$author_id = get_post_field( 'post_author' );
echo '
';
}
// Render Post Comments
public function render_post_comments( $settings, $class ) {
$count = get_comments_number();
if ( comments_open() ) {
if ( $count == 1 ) {
$text = $count .' '. $settings['element_comments_text_2'];
} elseif ( $count > 1 ) {
$text = $count .' '. $settings['element_comments_text_3'];
} else {
$text = $settings['element_comments_text_1'];
}
echo '
';
}
}
// Render Post Read More
public function render_post_read_more( $settings, $class ) {
$read_more_animation = ! wpr_fs()->can_use_premium_code() ? 'wpr-button-none' : $this->get_settings()['read_more_animation'];
$open_links_in_new_tab = 'yes' === $this->get_settings()['open_links_in_new_tab'] ? '_blank' : '_self';
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, '
';
echo '
';
}
// Render Post Custom Field
public function render_post_custom_field( $settings, $class, $post_id ) {}
// Render Post Element Separator
public function render_post_element_separator( $settings, $class ) {
echo '
';
}
// Render Post Taxonomies
public function render_post_taxonomies( $settings, $class, $post_id ) {
$terms = wp_get_post_terms( $post_id, $settings['element_select'] );
$count = 0;
$tax1_pointer = ! wpr_fs()->can_use_premium_code() ? 'none' : $this->get_settings()['tax1_pointer'];
$tax1_pointer_animation = ! wpr_fs()->can_use_premium_code() ? 'fade' : $this->get_settings()['tax1_pointer_animation'];
$tax2_pointer = ! wpr_fs()->can_use_premium_code() ? 'none' : $this->get_settings()['tax2_pointer'];
$tax2_pointer_animation = ! wpr_fs()->can_use_premium_code() ? 'fade' : $this->get_settings()['tax2_pointer_animation'];
$pointer_item_class = (isset($this->get_settings()['tax1_pointer']) && 'none' !== $this->get_settings()['tax1_pointer']) || (isset($this->get_settings()['tax2_pointer']) && 'none' !== $this->get_settings()['tax2_pointer']) ? 'wpr-pointer-item' : '';
// Pointer Class
if ( 'wpr-grid-tax-style-1' === $settings['element_tax_style'] ) {
$class .= ' wpr-pointer-'. $tax1_pointer;
$class .= ' wpr-pointer-line-fx wpr-pointer-fx-'. $tax1_pointer_animation;
} else {
$class .= ' wpr-pointer-'. $tax2_pointer;
$class .= ' wpr-pointer-line-fx wpr-pointer-fx-'. $tax2_pointer_animation;
}
echo '
';
echo '
';
// Text: Before
if ( 'before' === $settings['element_extra_text_pos'] ) {
echo '';
}
// 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 '';
}
// Taxonomies
foreach ( $terms as $term ) {
// Custom Colors
$enable_custom_colors = ! wpr_fs()->can_use_premium_code() ? '' : $this->get_settings()['tax1_custom_color_switcher'];
if ( 'yes' === $enable_custom_colors ) {
$custom_tax_styles = '';
$cfc_text = get_term_meta($term->term_id, $this->get_settings()['tax1_custom_color_field_text'], true);
$cfc_bg = get_term_meta($term->term_id, $this->get_settings()['tax1_custom_color_field_bg'], true);
$color_styles = 'color:'. $cfc_text .'; background-color:'. $cfc_bg .'; border-color:'. $cfc_bg .';';
$css_selector = '.elementor-element'. $this->get_unique_selector() .' .wpr-grid-tax-style-1 .inner-block a.wpr-tax-id-'. esc_attr($term->term_id);
$custom_tax_styles .= $css_selector .'{'. $color_styles .'}';
echo ''; // TODO: take out of loop if possible
}
echo '
'. esc_html( $term->name );
if ( ++$count !== count( $terms ) ) {
echo ''. esc_html($settings['element_tax_sep']) .'';
}
echo '';
}
// 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 '';
}
// Text: After
if ( 'after' === $settings['element_extra_text_pos'] ) {
echo '';
}
echo '
';
echo '
';
}
// Get Elements
public function get_elements( $type, $settings, $class, $post_id ) {
if ( 'pro-lk' == $type || 'pro-shr' == $type || 'pro-cf' == $type ) {
$type = 'title';
}
switch ( $type ) {
case 'title':
$this->render_post_title( $settings, $class );
break;
case 'content':
$this->render_post_content( $settings, $class );
break;
case 'excerpt':
$this->render_post_excerpt( $settings, $class );
break;
case 'date':
$this->render_post_date( $settings, $class );
break;
case 'time':
$this->render_post_time( $settings, $class );
break;
case 'author':
$this->render_post_author( $settings, $class );
break;
case 'comments':
$this->render_post_comments( $settings, $class );
break;
case 'read-more':
$this->render_post_read_more( $settings, $class );
break;
case 'likes':
$this->render_post_likes( $settings, $class, $post_id );
break;
case 'sharing':
$this->render_post_sharing_icons( $settings, $class );
break;
case 'lightbox':
$this->render_post_lightbox( $settings, $class, $post_id );
break;
case 'custom-field':
$this->render_post_custom_field( $settings, $class, $post_id );
break;
case 'separator':
$this->render_post_element_separator( $settings, $class );
break;
default:
$this->render_post_taxonomies( $settings, $class, $post_id );
break;
}
}
// Get Elements by Location
public function get_elements_by_location( $location, $settings, $post_id ) {
$locations = [];
foreach ( $settings['grid_elements'] as $data ) {
$place = $data['element_location'];
$align_vr = $data['element_align_vr'];
if ( ! wpr_fs()->can_use_premium_code() ) {
$align_vr = 'middle';
}
if ( ! isset($locations[$place]) ) {
$locations[$place] = [];
}
if ( 'over' === $place ) {
if ( ! isset($locations[$place][$align_vr]) ) {
$locations[$place][$align_vr] = [];
}
array_push( $locations[$place][$align_vr], $data );
} else {
array_push( $locations[$place], $data );
}
}
if ( ! empty( $locations[$location] ) ) {
if ( 'over' === $location ) {
foreach ( $locations[$location] as $align => $elements ) {
if ( 'middle' === $align ) {
echo '
';
}
echo '
';
foreach ( $elements as $data ) {
// Get Class
$class = 'wpr-grid-item-'. $data['element_select'];
$class .= ' elementor-repeater-item-'. $data['_id'];
$class .= ' wpr-grid-item-display-'. $data['element_display'];
$class .= ' wpr-grid-item-align-'. $data['element_align_hr'];
$class .= $this->get_animation_class( $data, 'element' );
// Element
$this->get_elements( $data['element_select'], $data, $class, $post_id );
}
echo '
';
if ( 'middle' === $align ) {
echo '
';
}
}
} else {
echo '
';
foreach ( $locations[$location] as $data ) {
// Get Class
$class = 'wpr-grid-item-'. $data['element_select'];
$class .= ' elementor-repeater-item-'. $data['_id'];
$class .= ' wpr-grid-item-display-'. $data['element_display'];
$class .= ' wpr-grid-item-align-'. $data['element_align_hr'];
// Element
$this->get_elements( $data['element_select'], $data, $class, $post_id );
}
echo '
';
}
}
}
// Render Grid Filters
public function render_grid_filters( $settings ) {
$taxonomy = $settings['filters_select'];
// Return if Disabled
if ( '' === $taxonomy || ! isset( $settings[ 'query_taxonomy_'. $taxonomy ] ) ) {
return;
}
// Get Custom Filters
$custom_filters = $settings[ 'query_taxonomy_'. $taxonomy ];
if ( ! wpr_fs()->can_use_premium_code() ) {
$settings['filters_default_filter'] = '';
$settings['filters_icon_align'] = '';
$settings['filters_count'] = '';
$settings['filters_pointer'] = 'none';
$settings['filters_pointer_animation'] = 'none';
}
// Icon
$left_icon = 'left' === $settings['filters_icon_align'] ? '
' : '';
$right_icon = 'right' === $settings['filters_icon_align'] ? '
' : '';
// Separator
$left_separator = 'left' === $settings['filters_separator_align'] ? '
'. esc_html($settings['filters_separator']) .'' : '';
$right_separator = 'right' === $settings['filters_separator_align'] ? '
'. esc_html($settings['filters_separator']) .'' : '';
// Count
$post_count = 'yes' === $settings['filters_count'] ? '
' : '';
// Pointer Class
$pointer_class = ' wpr-pointer-'. $settings['filters_pointer'];
$pointer_class .= ' wpr-pointer-line-fx wpr-pointer-fx-'. $settings['filters_pointer_animation'];
$pointer_item_class = (isset($settings['filters_pointer']) && 'none' !== $settings['filters_pointer']) ? 'class="wpr-pointer-item"' : '';
$pointer_item_class_name = (isset($settings['filters_pointer']) && 'none' !== $settings['filters_pointer']) ? 'wpr-pointer-item' : '';
// Filters List
echo '
';
// All Filter
if ( 'yes' === $settings['filters_all'] && 'yes' !== $settings['filters_linkable'] ) {
echo '- ';
echo ''. $left_icon . esc_html($settings['filters_all_text']) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
';
}
$q = get_queried_object();
// category title : custom post type archive title
$category_name = is_category() ? strtolower($q->name) : 'no-category';
// Custom Filters
if ( $settings['query_selection'] === 'dynamic' && ! empty( $custom_filters ) ) {
$parent_filters = [];
foreach ( $custom_filters as $key => $term_id ) {
$filter = get_term_by( 'id', $term_id, $taxonomy );
$data_attr = 'post_tag' === $taxonomy ? 'tag-'. $filter->slug : $taxonomy .'-'. $filter->slug;
$tax_data_attr = 'post_tag' === $taxonomy ? 'tag' : $taxonomy;
$term_data_attr = $filter->slug;
// GOGA - tested but needs advanced testing
if (strpos($data_attr, $category_name) !== false) {
$active_class = 'wpr-active-filter';
} else {
$active_class = '';
}
// Parent Filters
if ( 0 === $filter->parent ) {
$children = get_term_children( $filter->term_id, $taxonomy );
$data_role = ! empty($children) ? ' data-role="parent"' : '';
echo '- '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( 'yes' !== $settings['filters_linkable'] ) {
echo ''. $left_separator .''. $left_icon . esc_html($filter->name) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
echo ''. $left_separator .''. $left_icon . esc_html($filter->name) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '
';
// Get Sub Filters
} else {
array_push( $parent_filters, $filter->parent );
}
}
// All Filters
} else {
$all_filters = get_terms( $taxonomy );
$parent_filters = [];
foreach ( $all_filters as $key => $filter ) {
$data_attr = 'post_tag' === $taxonomy ? 'tag-'. $filter->slug : $taxonomy .'-'. $filter->slug;
$tax_data_attr = 'post_tag' === $taxonomy ? 'tag' : $taxonomy;
$term_data_attr = $filter->slug;
// GOGA - tested but needs advanced testing
if (strpos($data_attr, $category_name) !== false) {
$active_class = 'wpr-active-filter';
} else {
$active_class = '';
}
// Parent Filters
if ( 0 === $filter->parent ) {
$children = get_term_children( $filter->term_id, $taxonomy );
$data_role = ! empty($children) ? ' data-role="parent"' : '';
$hidden_class = $this->get_hidden_filter_class($filter->slug, $settings);
echo '- '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( 'yes' !== $settings['filters_linkable'] ) {
echo ''. $left_separator .''. $left_icon . esc_html($filter->name) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
echo ''. $left_separator .''. $left_icon . esc_html($filter->name) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '
';
// Get Sub Filters
} else {
array_push( $parent_filters, $filter->parent );
}
}
}
// Sub Filters
if ( 'yes' !== $settings['filters_linkable'] ) {
foreach ( array_unique( $parent_filters ) as $key => $parent_filter ) {
$parent = get_term_by( 'id', $parent_filter, $taxonomy );
$children = get_term_children( $parent_filter, $taxonomy );
$data_attr = 'post_tag' === $taxonomy ? 'tag-'. $parent->slug : $taxonomy .'-'. $parent->slug;
$tax_data_attr = 'post_tag' === $taxonomy ? 'tag' : $taxonomy;
$term_data_attr = $filter->slug;
echo '';
echo '- ';
echo '';
echo ' '. esc_html__( 'Back', 'wpr-addons' );
echo '';
echo '
';
foreach ( $children as $child ) {
$sub_filter = get_term_by( 'id', $child, $taxonomy );
$data_attr = 'post_tag' === $taxonomy ? 'tag-'. $sub_filter->slug : $taxonomy .'-'. $sub_filter->slug;
echo '- ';
echo ''. $left_separator .''. $left_icon . esc_html($sub_filter->name) . $right_icon . $post_count .''. $right_separator; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
';
}
echo '
';
}
}
echo '
';
}
public function get_hidden_filter_class($slug, $settings) {
$posts = new \WP_Query( $this->get_main_query_args() );
$visible_categories = [];
if ( $posts->have_posts() ) {
while ( $posts->have_posts() ) {
$posts->the_post();
$categories = get_the_category();
foreach ($categories as $key => $category) {
array_push($visible_categories, $category->slug);
}
}
$visible_categories = array_unique($visible_categories);
wp_reset_postdata();
}
return ( ! in_array($slug, $visible_categories) && 'yes' == $settings['filters_hide_empty'] ) ? ' wpr-hidden-element' : '';
}
// Render Grid Pagination
public function render_grid_pagination( $settings ) {
// Return if Disabled
if ( 'yes' !== $settings['layout_pagination'] || 1 === $this->get_max_num_pages( $settings ) || 'slider' === $settings['layout_select'] ) {
return;
}
global $paged;
$pages = $this->get_max_num_pages( $settings );
// $paged = empty( $paged ) ? 1 : $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 ( ! wpr_fs()->can_use_premium_code() ) {
$settings['pagination_type'] = 'pro-is' == $settings['pagination_type'] ? 'default' : $settings['pagination_type'];
}
echo '';
}
// Grid Settings
public function add_grid_settings( $settings ) {
if ( ! wpr_fs()->can_use_premium_code() ) {
$settings['layout_select'] = 'pro-ms' == $settings['layout_select'] ? 'fitRows' : $settings['layout_select'];
$settings['filters_deeplinking'] = '';
$settings['filters_count'] = '';
$settings['filters_default_filter'] = '';
if ( 'pro-fd' == $settings['filters_animation'] || 'pro-fs' == $settings['filters_animation'] ) {
$settings['filters_animation'] = 'zoom';
}
}
if ( 'fitRows' == $settings['layout_select'] ) {
$stick_last_element_to_bottom = $settings['stick_last_element_to_bottom'];
} else {
$stick_last_element_to_bottom = 'no';
}
$gutter_hr_widescreen = isset($settings['layout_gutter_hr_widescreen']['size']) ? $settings['layout_gutter_hr_widescreen']['size'] : $settings['layout_gutter_hr']['size'];
$gutter_hr_desktop = $settings['layout_gutter_hr']['size'];
$gutter_hr_laptop = isset($settings['layout_gutter_hr_laptop']['size']) ? $settings['layout_gutter_hr_laptop']['size'] : $gutter_hr_desktop;
$gutter_hr_tablet_extra = isset($settings['layout_gutter_hr_tablet_extra']['size']) ? $settings['layout_gutter_hr_tablet_extra']['size'] : $gutter_hr_laptop;
$gutter_hr_tablet = isset($settings['layout_gutter_hr_tablet']['size']) ? $settings['layout_gutter_hr_tablet']['size'] : $gutter_hr_tablet_extra;
$gutter_hr_mobile_extra = isset($settings['layout_gutter_hr_mobile_extra']['size']) ? $settings['layout_gutter_hr_mobile_extra']['size'] : $gutter_hr_tablet;
$gutter_hr_mobile = isset($settings['layout_gutter_hr_mobile']['size']) ? $settings['layout_gutter_hr_mobile']['size'] : $gutter_hr_mobile_extra;
$gutter_vr_widescreen = isset($settings['layout_gutter_vr_widescreen']['size']) ? $settings['layout_gutter_vr_widescreen']['size'] : $settings['layout_gutter_vr']['size'];
$gutter_vr_desktop = $settings['layout_gutter_vr']['size'];
$gutter_vr_laptop = isset($settings['layout_gutter_vr_laptop']['size']) ? $settings['layout_gutter_vr_laptop']['size'] : $gutter_vr_desktop;
$gutter_vr_tablet_extra = isset($settings['layout_gutter_vr_tablet_extra']['size']) ? $settings['layout_gutter_vr_tablet_extra']['size'] : $gutter_vr_laptop;
$gutter_vr_tablet = isset($settings['layout_gutter_vr_tablet']['size']) ? $settings['layout_gutter_vr_tablet']['size'] : $gutter_vr_tablet_extra;
$gutter_vr_mobile_extra = isset($settings['layout_gutter_vr_mobile_extra']['size']) ? $settings['layout_gutter_vr_mobile_extra']['size'] : $gutter_vr_tablet;
$gutter_vr_mobile = isset($settings['layout_gutter_vr_mobile']['size']) ? $settings['layout_gutter_vr_mobile']['size'] : $gutter_vr_mobile_extra;
$layout_settings = [
'layout' => $settings['layout_select'],
'stick_last_element_to_bottom' => $stick_last_element_to_bottom,
'columns_desktop' => $settings['layout_columns'],
'gutter_hr' => $gutter_hr_desktop,
'gutter_hr_mobile' => $gutter_hr_mobile,
'gutter_hr_mobile_extra' => $gutter_hr_mobile_extra,
'gutter_hr_tablet' => $gutter_hr_tablet,
'gutter_hr_tablet_extra' => $gutter_hr_tablet_extra,
'gutter_hr_laptop' => $gutter_hr_laptop,
'gutter_hr_widescreen' => $gutter_hr_widescreen,
'gutter_vr' => $gutter_vr_desktop,
'gutter_vr_mobile' => $gutter_vr_mobile,
'gutter_vr_mobile_extra' => $gutter_vr_mobile_extra,
'gutter_vr_tablet' => $gutter_vr_tablet,
'gutter_vr_tablet_extra' => $gutter_vr_tablet_extra,
'gutter_vr_laptop' => $gutter_vr_laptop,
'gutter_vr_widescreen' => $gutter_vr_widescreen,
'animation' => $settings['layout_animation'],
'animation_duration' => $settings['layout_animation_duration'],
'animation_delay' => $settings['layout_animation_delay'],
'deeplinking' => $settings['filters_deeplinking'],
'filters_linkable' => $settings['filters_linkable'],
'filters_default_filter' => $settings['filters_default_filter'],
'filters_count' => $settings['filters_count'],
'filters_hide_empty' => $settings['filters_hide_empty'],
'filters_animation' => $settings['filters_animation'],
'filters_animation_duration' => $settings['filters_animation_duration'],
'filters_animation_delay' => $settings['filters_animation_delay'],
'pagination_type' => $settings['pagination_type'],
'pagination_max_pages' => $this->get_max_num_pages( $settings ),
];
if ( 'list' === $settings['layout_select'] ) {
$layout_settings['media_align'] = $settings['layout_list_align'];
$layout_settings['media_width'] = $settings['layout_list_media_width']['size'];
$layout_settings['media_distance'] = $settings['layout_list_media_distance']['size'];
}
if ( ! wpr_fs()->can_use_premium_code() ) {
$settings['lightbox_popup_thumbnails'] = '';
$settings['lightbox_popup_thumbnails_default'] = '';
$settings['lightbox_popup_sharing'] = '';
}
$layout_settings['lightbox'] = [
'selector' => '.wpr-grid-image-wrap',
'iframeMaxWidth' => '60%',
'hash' => false,
'autoplay' => $settings['lightbox_popup_autoplay'],
'pause' => $settings['lightbox_popup_pause'] * 1000,
'progressBar' => $settings['lightbox_popup_progressbar'],
'counter' => $settings['lightbox_popup_counter'],
'controls' => $settings['lightbox_popup_arrows'],
'getCaptionFromTitleOrAlt' => $settings['lightbox_popup_captions'],
'thumbnail' => $settings['lightbox_popup_thumbnails'],
'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'],
'share' => $settings['lightbox_popup_sharing'],
'zoom' => $settings['lightbox_popup_zoom'],
'fullScreen' => $settings['lightbox_popup_fullscreen'],
'download' => $settings['lightbox_popup_download'],
];
// $layout_settings['grid_settings'] = [esc_attr( json_encode( $settings ) )];
if ( 'yes' === $settings['filters_experiment'] ) {
$layout_settings['grid_settings'] = $settings;
}
$this->add_render_attribute( 'grid-settings', [
'data-settings' => wp_json_encode( $layout_settings ),
] );
}
public function add_slider_settings( $settings ) {
$slider_is_rtl = is_rtl();
$slider_direction = $slider_is_rtl ? 'rtl' : 'ltr';
if ( ! wpr_fs()->can_use_premium_code() ) {
$settings['layout_slider_autoplay'] = '';
$settings['layout_slider_autoplay_duration'] = 0;
$settings['layout_slider_pause_on_hover'] = '';
}
if ( 'pro-3' == $settings['layout_slider_amount'] || 'pro-4' == $settings['layout_slider_amount'] || 'pro-5' == $settings['layout_slider_amount'] || 'pro-6' == $settings['layout_slider_amount'] ) {
$settings['layout_slider_amount'] = 1;
}
$slider_options = [
'rtl' => $slider_is_rtl,
'infinite' => ( $settings['layout_slider_loop'] === 'yes' ),
'speed' => absint( $settings['layout_slider_effect_duration'] * 1000 ),
'arrows' => true,
'dots' => true,
'autoplay' => ( $settings['layout_slider_autoplay'] === 'yes' ),
'autoplaySpeed' => absint( $settings['layout_slider_autoplay_duration'] * 1000 ),
'pauseOnHover' => $settings['layout_slider_pause_on_hover'],
'prevArrow' => '#wpr-grid-slider-prev-'. $this->get_id(),
'nextArrow' => '#wpr-grid-slider-next-'. $this->get_id(),
'sliderSlidesToScroll' => $settings['layout_slides_to_scroll'] ? absint( $settings['layout_slides_to_scroll'] ) : 1,
];
if ( ! wpr_fs()->can_use_premium_code() ) {
$settings['lightbox_popup_thumbnails'] = '';
$settings['lightbox_popup_thumbnails_default'] = '';
$settings['lightbox_popup_sharing'] = '';
}
// Lightbox Settings
$slider_options['lightbox'] = [
'selector' => 'article:not(.slick-cloned) .wpr-grid-image-wrap',
'iframeMaxWidth' => '60%',
'hash' => false,
'autoplay' => $settings['lightbox_popup_autoplay'],
'pause' => $settings['lightbox_popup_pause'] * 1000,
'progressBar' => $settings['lightbox_popup_progressbar'],
'counter' => $settings['lightbox_popup_counter'],
'controls' => $settings['lightbox_popup_arrows'],
'getCaptionFromTitleOrAlt' => $settings['lightbox_popup_captions'],
'thumbnail' => $settings['lightbox_popup_thumbnails'],
'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'],
'share' => $settings['lightbox_popup_sharing'],
'zoom' => $settings['lightbox_popup_zoom'],
'fullScreen' => $settings['lightbox_popup_fullscreen'],
'download' => $settings['lightbox_popup_download'],
];
if ( $settings['layout_slider_amount'] === 1 && $settings['layout_slider_effect'] === 'fade' ) {
$slider_options['fade'] = true;
}
$this->add_render_attribute( 'slider-settings', [
'dir' => esc_attr( $slider_direction ),
'data-slick' => wp_json_encode( $slider_options ),
] );
}
protected function render() {
// Get Settings
$settings = $this->get_settings();
// Get Posts
$posts = new \WP_Query( $this->get_main_query_args() );
// Loop: Start
if ( $posts->have_posts() ) :
// Grid Settings
if ( 'slider' !== $settings['layout_select'] ) {
// Filters
$this->render_grid_filters( $settings );
$this->add_grid_settings( $settings );
$render_attribute = $this->get_render_attribute_string( 'grid-settings' );
// Slider Settings
} else {
$this->add_slider_settings( $settings );
$render_attribute = $this->get_render_attribute_string( 'slider-settings' );
}
// Grid Wrap
echo '
';
while ( $posts->have_posts() ) : $posts->the_post();
// Post Class
$post_class = implode( ' ', get_post_class( 'wpr-grid-item elementor-clearfix', get_the_ID() ) );
// Grid Item
echo '';
// Password Protected Form
$this->render_password_protected_input( $settings );
// Inner Wrapper
echo '';
// Content: Above Media
$this->get_elements_by_location( 'above', $settings, get_the_ID() );
// Media
if ( has_post_thumbnail() ) {
echo '
';
}
// Content: Below Media
$this->get_elements_by_location( 'below', $settings, get_the_ID() );
echo '
'; // End .wpr-grid-item-inner
echo ''; // End .wpr-grid-item
endwhile;
// Grid Wrap
echo '';
// reset
wp_reset_postdata();
if ( 'slider' === $settings['layout_select'] ) {
// Slider Navigation
echo '
';
echo '
'. Utilities::get_wpr_icon( $settings['layout_slider_nav_icon'], '' ) .'
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
'. Utilities::get_wpr_icon( $settings['layout_slider_nav_icon'], '' ) .'
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
';
// Slider Dots
echo '
';
}
// Pagination
$this->render_grid_pagination( $settings );
// No Posts Found
else:
if ( 'dynamic' === $settings['query_selection'] ) {
echo '
'. esc_html($settings['query_not_found_text']) .'
';
}
// Loop: End
endif;
}
}