Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/bopea-function/block//large-post.php
<?php
namespace bopeaElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Typography;
use Elementor\Schemes\Color;
use Elementor\Schemes\Typography;
use Elementor\Utils;
use Elementor\Control_Media;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Icons_Manager;
if ( ! defined( 'ABSPATH' ) ) exit;
class bopea_large_post extends Widget_Base {
public $base;
public function get_name() {
return 'bopea-large-post';
}
public function get_title() {
return esc_html__( 'Large Post', 'bopea-function' );
}
public function get_icon() {
return 'eicon-elementor-circle jl-icons';
}
public function get_categories() {
return [ 'bopea-elements' ];
}
protected function register_controls() {
$this->start_controls_section(
'section_tab',
[
'label' => esc_html__('Post Query And Settings', 'bopea-function'),
]
);
$this->add_control(
'post_type',
[
'label' =>esc_html__('Post types', 'bopea-function'),
'description' => esc_html__( 'Choose post type to display posts', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => 'post',
'options' => $this->post_get_type(),
]
);
$this->add_control(
'post_type_tax',
[
'label' =>esc_html__('Post taxonomy', 'bopea-function'),
'description' => esc_html__( 'Choose post type (category or tag)', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => $this->post_get_taxs(),
'condition' => [
'post_type!' => ['post']
]
]
);
$this->add_control(
'term_slugs', [
'label' => esc_html__( 'Term Slug', 'bopea-function' ),
'description' => esc_html__( 'Example: slug1,slug2,slug3', 'bopea-function' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'post_type!' => ['post']
]
]
);
$this->add_control(
'categories',
[
'label' =>esc_html__('Select Categories', 'bopea-function'),
'type' => Controls_Manager::SELECT2,
'options' => $this->post_categories(),
'label_block' => true,
'multiple' => true,
'condition' => [
'post_type' => ['post']
]
]
);
$this->add_control(
'tags', [
'label' => esc_html__( 'Tag Slug', 'bopea-function' ),
'description' => esc_html__( 'Example: tagslug1,tagslug2,tagslug3', 'bopea-function' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'post_type' => ['post']
]
]
);
$this->add_control(
'author',
[
'label' =>esc_html__('Author Filter', 'bopea-function'),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => $this->post_author(),
'condition' => [
'post_type' => ['post']
]
]
);
// $this->add_control(
// 'author',
// [
// 'label' =>esc_html__('Select Author', 'bopea-function'),
// 'type' => Controls_Manager::SELECT2,
// 'options' => $this->post_author(),
// 'label_block' => true,
// 'multiple' => true,
// ]
// );
$this->add_control(
'posts_per_page',
array(
'label' => esc_html__( 'Posts per Page', 'bopea-function' ),
'type' => Controls_Manager::NUMBER,
'default' => '6'
)
);
$this->add_control(
'offset',
array(
'label' => esc_html__( 'Post Offset', 'bopea-function' ),
'type' => Controls_Manager::NUMBER,
'default' => '',
)
);
$this->add_control(
'format',
array(
'label' => esc_html__( 'Post Format', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'options' => [
'0' => esc_html__( 'All', 'bopea-function' ),
'gallery' => esc_html__( 'Gallery', 'bopea-function' ),
'video' => esc_html__( 'Video', 'bopea-function' ),
'audio' => esc_html__( 'Audio', 'bopea-function' ),
'quote' => esc_html__( 'Quote', 'bopea-function' ),
],
'default' => '0',
'condition' => [
'post_type' => ['post']
]
)
);
$this->add_control(
'post_not_in', [
'label' => esc_html__( 'Exclude Post IDs', 'bopea-function' ),
'description' => esc_html__( 'Example: 1,2,3', 'bopea-function' ),
'default' => '',
'type' => Controls_Manager::TEXT,
'label_block' => true
]
);
$this->add_control(
'post_in', [
'label' => esc_html__( 'Post IDs Filter', 'bopea-function' ),
'description' => esc_html__( 'Example: 1,2,3', 'bopea-function' ),
'default' => '',
'type' => Controls_Manager::TEXT,
'label_block' => true
]
);
$this->add_control(
'ignore_sticky_posts',
[
'label' => esc_html__( 'Enable sticky posts', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'order',
[
'label' =>esc_html__( 'Sort Order', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => 'date_post',
'options' => [
'date_post' =>esc_html__( 'Latest post', 'bopea-function' ),
'rand' =>esc_html__( 'Random', 'bopea-function' ),
'update' =>esc_html__( 'Latest updated', 'bopea-function' ),
'comment_count' =>esc_html__( 'Popular comment', 'bopea-function' ),
'author' =>esc_html__( 'Author', 'bopea-function' ),
'popular_most' =>esc_html__( 'Popular views', 'bopea-function' ),
'popular_by_month' =>esc_html__( 'Popular views by month', 'bopea-function' ),
'popular_by_week' =>esc_html__( 'Popular views by week', 'bopea-function' ),
'alphabetical_order_decs' =>esc_html__( 'Title DECS', 'bopea-function' ),
'alphabetical_order_asc' =>esc_html__( 'Title ACS', 'bopea-function' ),
],
]
);
$this->add_control(
'tabs_link',
array(
'label' => esc_html__( 'Tab Link', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => [
'none' => esc_html__( 'None', 'bopea-function' ),
'category' => esc_html__( 'Categories', 'bopea-function' ),
'tag' => esc_html__( 'Tags', 'bopea-function' ),
],
'condition' => [
'post_type' => ['post']
]
)
);
$this->add_control(
'tabs_link_ids',
array(
'label' => esc_html__( 'Filter ID', 'bopea-function' ),
'type' => Controls_Manager::TEXT,
'description' => esc_html__( 'Add ID of category or tag (Example: 1,2,3)', 'bopea-function' ),
'default' => '',
'condition' => [
'post_type' => ['post']
]
)
);
$this->add_control(
'tabs_link_label',
array(
'label' => esc_html__( 'Tab Label', 'bopea-function' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'All', 'bopea-function' ),
'condition' => [
'post_type' => ['post']
]
)
);
$this->add_control(
'pagination',
array(
'label' => esc_html__( 'Pagination', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'options' => [
'0' => esc_html__( 'None', 'bopea-function' ),
'next_prev' => esc_html__( 'Arrow', 'bopea-function' ),
'loadmore' => esc_html__( 'Load More', 'bopea-function' ),
'autoload' => esc_html__( 'Auto Load', 'bopea-function' ),
],
'default' => '0',
)
);
$this->end_controls_section();
//Title Style Section
$this->start_controls_section(
'section_tab_style', [
'label' => esc_html__( 'Post Custom Style', 'bopea-function' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'layout_style',
[
'label' =>esc_html__( 'Blog layout style', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => 'large_layout1',
'options' => [
'large_layout1' =>esc_html__( 'Layout Classic', 'bopea-function' ),
'large_layout2' =>esc_html__( 'Layout Overlay', 'bopea-function' ),
'large_layout3' =>esc_html__( 'Layout Overlay Caption Background', 'bopea-function' ),
],
]
);
$this->add_control(
'jl_cus_img',
[
'label' =>esc_html__( 'Image size', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => [
'' =>esc_html__( 'Default image size', 'bopea-function' ),
'bopea_large' =>esc_html__( '1600 x 0', 'bopea-function' ),
'bopea_medium' =>esc_html__( '1100 x 0', 'bopea-function' ),
'bopea_small' =>esc_html__( '150 x 150', 'bopea-function' ),
'bopea_layouts' =>esc_html__( '680 x 0', 'bopea-function' ),
'medium' =>esc_html__( 'Medium', 'bopea-function' ),
],
]
);
$this->add_control(
'main_tag',
[
'label' => __( 'Main title Tag', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
],
'default' => 'h2',
]
);
$this->add_responsive_control(
'jl_item_img_space',
[
'label' => __( 'Post height', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 400,
],
'tablet_default' => [
'size' => 400,
],
'mobile_default' => [
'size' => 300,
],
'range' => [
'px' => [
'min' => 1,
'max' => 3000,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-post-h: {{SIZE}}px;',
],
'condition' => [
'layout_style' => ['large_layout2', 'large_layout3']
]
]
);
$this->add_responsive_control(
'g_font_size',
[
'label' => __( 'Title font size', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 35,
],
'tablet_default' => [
'size' => 30,
],
'mobile_default' => [
'size' => 23,
],
'range' => [
'px' => [
'min' => 1,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-title-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'main_typo',
'label' =>esc_html__( 'Title typography', 'bopea-function' ),
'selector' => '{{WRAPPER}} .jl_lg_op .jl_fe_title',
]
);
$this->add_responsive_control(
'jl_cap_width',
[
'label' => __( 'Caption width', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 650,
],
'tablet_default' => [
'size' => 650,
],
'mobile_default' => [
'size' => 650,
],
'range' => [
'px' => [
'min' => 1,
'max' => 3000,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-cap-w: {{SIZE}}px;',
],
]
);
$this->add_responsive_control(
'jl_cap_ma',
[
'label' => __( 'Caption margin', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-cap-ma: {{SIZE}}px;',
]
]
);
$this->add_responsive_control(
'jl_cap_pa',
[
'label' => __( 'Caption padding', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-cap-pa: {{SIZE}}px;',
],
'condition' => [
'layout_style' => ['large_layout3']
]
]
);
$this->add_responsive_control(
'jl_item_row_space',
[
'label' => __( 'Row space', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 80,
],
'tablet_default' => [
'size' => 40,
],
'mobile_default' => [
'size' => 40,
],
'range' => [
'px' => [
'min' => 0,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jlrow-gap: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'jl_item_img_radius',
[
'label' => __( 'Post border radius', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .block-section' => '--jlc-car-radius: {{SIZE}}px; --jl-border-rounded: {{SIZE}}px;',
],
]
);
$this->add_responsive_control(
'jl_num_text_line',
[
'label' => __( 'Number line of text', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 10,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}}' => '--jl-num-line: {{SIZE}};',
],
]
);
$this->add_control(
'en_meta_line',
[
'label' => esc_html__( 'Enable meta line', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_post_meta' => 'border-top: 1px solid var(--jl-ov-lcor, #ffffff50); padding-top: var(--jl-ov-msp, 13px); margin-top: var(--jl-ov-msp, 13px);',
],
]
);
$this->add_responsive_control(
'jl_mli_space',
[
'label' => __( 'Meta line space', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1,
'max' => 100,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}}' => '--jl-ov-msp: {{SIZE}}px;',
],
'condition' => [
'en_meta_line!' => ''
]
]
);
$this->add_control(
'jl_mli_color',
[
'label' => __( 'Meta line color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}}' => '--jl-ov-lcor: {{VALUE}};',
],
'condition' => [
'en_meta_line!' => ''
]
]
);
$this->add_control(
'jl_gradient_ov',
[
'label' => esc_html__( 'Enable gradient background', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'yes',
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_imgl' => 'background-color: transparent !important; background: linear-gradient(180deg, rgba(0, 0, 0, 0) var(--jl-ov-bg-pos), var(--jl-ov-bg) var(--jl-ov-bgc-pos)) !important;',
],
'condition' => [
'layout_style' => ['large_layout2']
]
]
);
$this->add_control(
'jl_flip_bg',
[
'label' => esc_html__( 'Gradient background from top', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_imgl' => '-moz-transform: scale(-1, -1); -o-transform: scale(-1, -1); -webkit-transform: scale(-1, -1); transform: scale(-1, -1);'
],
'condition' => [
'jl_gradient_ov!' => '',
'layout_style' => ['large_layout2']
]
]
);
$this->add_control(
'sl_ov_bg',
[
'label' => __( 'Overlay background color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_imgl' => '--jl-ov-bg: {{VALUE}}; background-color: {{VALUE}};',
],
'condition' => [
'layout_style' => ['large_layout2']
]
]
);
$this->add_responsive_control(
'jl_bg_pos',
[
'label' => __( 'Background transparent position', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_imgl' => '--jl-ov-bg-pos: {{SIZE}}%',
],
'condition' => [
'jl_gradient_ov!' => '',
'layout_style' => ['large_layout2']
]
]
);
$this->add_responsive_control(
'jl_bgc_pos',
[
'label' => __( 'Background color position', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ov_el .jl_imgl' => '--jl-ov-bgc-pos: {{SIZE}}%',
],
'condition' => [
'jl_gradient_ov!' => '',
'layout_style' => ['large_layout2']
]
]
);
$this->add_responsive_control(
'jl_text_align',
array(
'label' => __( 'Text alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => __( 'Left', 'bopea-function' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => __( 'Center', 'bopea-function' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => __( 'Right', 'bopea-function' ),
'icon' => 'eicon-text-align-right',
),
),
'default' => 'center',
'toggle' => false,
'selectors' => array(
'{{WRAPPER}} .jl_lg_opt' => '--jl-t-align: {{VALUE}};',
)
)
);
$this->add_responsive_control(
'cap_h_align',
[
'label' => __( 'Horizontal Alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [
'title' => __( 'Left', 'bopea-function' ),
'icon' => 'eicon-h-align-left',
],
'center' => [
'title' => __( 'Center', 'bopea-function' ),
'icon' => 'eicon-h-align-center',
],
'flex-end' => [
'title' => __( 'Right', 'bopea-function' ),
'icon' => 'eicon-h-align-right',
],
],
'default' => 'center',
'toggle' => true,
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-algin-h: {{VALUE}}',
],
]
);
$this->add_responsive_control(
'cap_v_align',
[
'label' => __( 'Vertical Alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [
'title' => __( 'Top', 'bopea-function' ),
'icon' => 'eicon-v-align-top',
],
'center' => [
'title' => __( 'Middle', 'bopea-function' ),
'icon' => 'eicon-v-align-middle',
],
'flex-end' => [
'title' => __( 'Bottom', 'bopea-function' ),
'icon' => 'eicon-v-align-bottom',
],
],
'default' => 'center',
'toggle' => true,
'selectors' => [
'{{WRAPPER}} .jl_lg_opt' => '--jl-v-align: {{VALUE}}',
],
'condition' => [
'layout_style' => ['large_layout2', 'large_layout3']
]
]
);
$this->add_control(
'jl_cls_rev',
[
'label' => esc_html__( 'Captions on top image', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .jl_lg_l1 .jl_lg_op_in' => 'flex-direction: column-reverse !important;',
],
'condition' => [
'layout_style' => ['large_layout1']
]
]
);
$this->add_control(
'jl_en_share',
[
'label' => esc_html__( 'Enable share', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => array(
'{{WRAPPER}} .jl_fot_share_i.jl_share_l_bg.jls_tooltip' => 'display: inline-flex !important;',
)
]
);
$this->add_control(
'jl_en_sh_l',
[
'label' => esc_html__( 'Enable share inline', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-sh-lp: 15px;',
],
'condition' => [
'jl_en_share!' => ['']
]
]
);
$this->add_control(
'jl_hide_cat',
[
'label' => esc_html__( 'Hide category', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_author',
[
'label' => esc_html__( 'Hide author', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_date',
[
'label' => esc_html__( 'Hide date', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_meta',
[
'label' => esc_html__( 'Hide author & date', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_desc',
[
'label' => esc_html__( 'Hide description', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_review',
[
'label' => esc_html__( 'Hide review', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'jl_hide_line',
[
'label' => esc_html__( 'Hide row line', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'cap_bg',
[
'label' => __( 'Caption background', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-cap-bg: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout3']
]
]
);
$this->add_control(
'cap_bg_dark',
[
'label' => __( 'Caption background dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-cap-bg: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout3']
]
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Title color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-txt-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'title_color_dark',
[
'label' => __( 'Title color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-txt-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'excp_color',
[
'label' => __( 'Excerpt color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-except-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'excp_color_dark',
[
'label' => __( 'Excerpt color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-except-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'meta_color',
[
'label' => __( 'Meta color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-meta-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'meta_color_dark',
[
'label' => __( 'Meta color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-meta-color: {{VALUE}}'
],
'condition' => [
'layout_style' => ['large_layout1','large_layout3']
]
]
);
$this->add_control(
'liline_color',
[
'label' => __( 'Line color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-post-line-color: {{VALUE}}'
]
]
);
$this->add_control(
'liline_color_dark',
[
'label' => __( 'Line color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-post-line-color: {{VALUE}}'
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_tab_filter', [
'label' => esc_html__( 'Tab Filter Style', 'bopea-function' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'jlc_tab_align',
array(
'label' => __( 'Tab alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'flex-start' => array(
'title' => __( 'Left', 'bopea-function' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => __( 'Center', 'bopea-function' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => __( 'Right', 'bopea-function' ),
'icon' => 'eicon-text-align-right',
),
),
'toggle' => false,
'selectors' => array(
'{{WRAPPER}} .jl_ajax_c' => 'justify-content: {{VALUE}};',
)
)
);
$this->add_responsive_control(
'tab_filter_size',
[
'label' => __( 'Tab filter font size', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ajax_c' => 'font-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'tab_filter_space',
[
'label' => __( 'Tab filter space', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ajax_c' => 'gap: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'tab_link_color',
[
'label' => __( 'Tab link color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .jl_ajax_c .ajax_nav_item a' => 'color: {{VALUE}} !important'
]
]
);
$this->add_control(
'tab_link_color_dark',
[
'label' => __( 'Tab link color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .jl_ajax_c .ajax_nav_item a' => 'color: {{VALUE}} !important'
]
]
);
$this->add_control(
'tab_link_h_color',
[
'label' => __( 'Tab link hover color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .jl_ajax_c .ajax_nav_item a:hover' => 'color: {{VALUE}} !important'
]
]
);
$this->add_control(
'tab_link_h_color_dark',
[
'label' => __( 'Tab link hover color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .jl_ajax_c .ajax_nav_item a:hover' => 'color: {{VALUE}} !important'
]
]
);
$this->add_control(
'tab_top_right',
[
'label' => esc_html__( 'Tab filter absolute position', 'bopea-function' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .jl_ajax_w' => 'position: absolute; z-index: 9;',
],
]
);
$this->add_responsive_control(
'tab_filter_top',
[
'label' => __( 'Top position', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => -60,
],
'range' => [
'px' => [
'min' => -500,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ajax_w' => 'top: {{SIZE}}{{UNIT}};',
],
'condition' => [
'tab_top_right' => 'yes'
]
]
);
$this->add_responsive_control(
'tab_filter_left',
[
'label' => __( 'Left position', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -500,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ajax_w' => 'left: {{SIZE}}{{UNIT}};',
],
'condition' => [
'tab_top_right' => 'yes'
]
]
);
$this->add_responsive_control(
'tab_filter_right',
[
'label' => __( 'Right position', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' => 0,
],
'range' => [
'px' => [
'min' => -500,
'max' => 500,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_ajax_w' => 'right: {{SIZE}}{{UNIT}};',
],
'condition' => [
'tab_top_right' => 'yes'
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_pagi_style', [
'label' => esc_html__( 'Pagination Style', 'bopea-function' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'jlc_align',
array(
'label' => __( 'Pagination alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => __( 'Left', 'bopea-function' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => __( 'Center', 'bopea-function' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => __( 'Right', 'bopea-function' ),
'icon' => 'eicon-text-align-right',
),
),
'toggle' => false,
'selectors' => array(
'{{WRAPPER}} .jl_el_nav_w' => 'justify-content: {{VALUE}};',
)
)
);
$this->add_responsive_control(
'g_pagination',
[
'label' => __( 'Pagination spacing', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => -150,
'max' => 400,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .jl_el_nav_w' => 'margin-top: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'g_pagination_radius',
[
'label' => __( 'Pagination border radius', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-fnav-radius: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'jl_nav_more',
[
'label' =>esc_html__( 'Load more padding', 'victro-function' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%'],
'default' => [
'top' => '',
'right' => '',
'bottom' => '' ,
'left' => '',
],
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-fnav-padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => [
'pagination' => ['loadmore']
]
]
);
$this->add_responsive_control(
'jl_nav_size',
[
'label' => __( 'Arrow nav size', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-size: {{SIZE}}{{UNIT}};',
],
'condition' => [
'pagination' => ['next_prev']
]
]
);
$this->add_responsive_control(
'jl_nav_fsize',
[
'label' => __( 'Font size', 'bopea-function' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
]
],
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-fsize: {{SIZE}}{{UNIT}};',
],
'condition' => [
'pagination' => ['next_prev','loadmore']
]
]
);
$this->start_controls_tabs( 'jl_fnav_tab_w' );
$this->start_controls_tab( 'jl_fnav_tab', [ 'label' => esc_html__( 'Normal', 'bopea-function' ) ] );
$this->add_control(
'jl_nav_bg',
[
'label' => __( 'Background color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-bg: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_bg_dark',
[
'label' => __( 'Background color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-nav-bg: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_color',
[
'label' => __( 'Color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-color: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_color_dark',
[
'label' => __( 'Color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-nav-color: {{VALUE}}'
]
]
);
$this->end_controls_tab();
$this->start_controls_tab( 'jl_fnav_tab_hover', [ 'label' => esc_html__( 'Hover', 'bopea-function' ) ] );
$this->add_control(
'jl_nav_bg_h',
[
'label' => __( 'Background color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-bg-h: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_bg_dark_h',
[
'label' => __( 'Background color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-nav-bg-h: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_color_h',
[
'label' => __( 'Color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .block-section' => '--jl-nav-color-h: {{VALUE}}'
]
]
);
$this->add_control(
'jl_nav_color_dark_h',
[
'label' => __( 'Color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}} .block-section' => '--jl-nav-color-h: {{VALUE}}'
]
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render( ) {
$settings = $this->get_settings();
if ( function_exists( 'bopea_lgrid' ) ) {
$settings['blockid'] = 'blockid_' . $this->get_id();
if(!empty($settings['categories'])){
$settings['categories'] = implode(',', $settings['categories']);
}
// if(isset($settings['author']) && is_array($settings['author']) ? $settings['author'] : []){
// $author = isset($settings['author']) && is_array($settings['author']) ? $settings['author'] : [];
// $settings['author'] = implode(',', $author);
// }else{
// $settings['author'] = $settings['author'];
// }
echo \bopea_lgrid( $settings );
}
}
public function post_categories() {
$terms = get_terms( array(
'taxonomy' => 'category',
'hide_empty' => false,
'posts_per_page' => -1,
'suppress_filters' => false,
) );
$cat_list = [];
foreach($terms as $post) {
$cat_list[$post->term_id] = [$post->name];
}
return $cat_list;
}
public function post_author() {
$blogusers = get_users( array(
'role__not_in' => array( 'subscriber' ),
'fields' => array( 'ID', 'display_name' )
) );
$user_list = [];
$user_list['none']= esc_html__( 'None', 'bopea-function' );
foreach($blogusers as $user) {
$user_list[$user->ID] = [$user->display_name];
}
return $user_list;
}
public function post_get_type() {
$post_types = get_post_types( '', 'names' );
$type_list = [];
$type_list['none']= esc_html__( 'None', 'bopea-function' );
if ( ! empty( $post_types ) ){
foreach($post_types as $p_type) {
$type_list[$p_type] = [$p_type];
}
}
return $type_list;
}
public function post_get_taxs() {
$taxonomies = get_taxonomies();
$type_taxs = [];
$type_taxs['none']= esc_html__( 'None', 'bopea-function' );
if ( ! empty( $taxonomies ) ){
foreach($taxonomies as $p_taxs) {
$type_taxs[$p_taxs] = [$p_taxs];
}
}
return $type_taxs;
}
}