<?php
namespace Elementor; // Custom widgets must be defined in the Elementor namespace
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly (security measure)
/**
 * Widget Name: Projects Carousel
 */
class PBMIT_PortfolioElement extends Widget_Base{
 	// The get_name() method is a simple one, you just need to return a widget name that will be used in the code.
	public function get_name() {
		return 'pbmit_portfolio_element';
	}
	// The get_title() method, which again, is a very simple one, you need to return the widget title that will be displayed as the widget label.
	public function get_title() {
		// Portfolio
		$portfolio_cpt_singular_title	= esc_attr__('Portfolio','xinterio');
		$portfolio_cpt_singular_title2	= get_theme_mod( 'portfolio-cpt-singular-title' );
		$portfolio_cpt_singular_title	= ( !empty($portfolio_cpt_singular_title2) ) ? $portfolio_cpt_singular_title2 : $portfolio_cpt_singular_title ;
		return sprintf( esc_attr__( 'Xinterio %1$s Element', 'xinterio' ), $portfolio_cpt_singular_title );
	}
	// The get_icon() method, is an optional but recommended method, it lets you set the widget icon. you can use any of the eicon or font-awesome icons, simply return the class name as a string.
	public function get_icon() {
		return 'fas fa-th-large';
	}
	// The get_categories method, lets you set the category of the widget, return the category name as a string.
	public function get_categories() {
		return [ 'xinterio_category' ];
	}
	public function __construct($data = [], $args = null) {
		parent::__construct($data, $args);
		if( !empty($data['settings']["view-type"]) && $data['settings']["view-type"]=='carousel' ){
			wp_enqueue_script( 'swiper' );
			wp_enqueue_style( 'swiper' );
		}
		if( !empty($data['settings']["sortable"]) && $data['settings']["sortable"]=='yes' ){
			wp_enqueue_script( 'isotope' );
		}
		if( !empty($data['settings']["view-type"]) && $data['settings']["view-type"]=='masonry' ){
			wp_enqueue_script( 'masonry' );
			wp_enqueue_script( 'isotope' );
		}
		if( ( !empty($data['settings']["view-type"]) && $data['settings']["view-type"]=='masonry' ) &&
		( !empty($data['settings']["infinite-scroll"]) && $data['settings']["infinite-scroll"]=='yes' )
		){
			wp_enqueue_script( 'infinite-scroll' );
		}
	}
	protected function register_controls() {
		// Portfolio
		$portfolio_cpt_title	= esc_attr__('Portfolio','xinterio');
		$portfolio_cpt_title2	= get_theme_mod( 'portfolio-cpt-title' );
		$portfolio_cpt_title	= ( !empty($portfolio_cpt_title2) ) ? $portfolio_cpt_title2 : $portfolio_cpt_title ;
		$portfolio_cpt_singular_title	= esc_attr__('Portfolio','xinterio');
		$portfolio_cpt_singular_title2	= get_theme_mod( 'portfolio-cpt-singular-title' );
		$portfolio_cpt_singular_title	= ( !empty($portfolio_cpt_singular_title2) ) ? $portfolio_cpt_singular_title2 : $portfolio_cpt_singular_title ;
		$portfolio_cat_singular_title	= esc_attr__('Portfolio Category','xinterio');
		$portfolio_cat_singular_title2	= get_theme_mod( 'portfolio-cat-singular-title' );
		$portfolio_cat_singular_title	= ( !empty($portfolio_cat_singular_title2) ) ? $portfolio_cat_singular_title2 : $portfolio_cat_singular_title ;
		// Style
		$this->start_controls_section(
			'style_section',
			[
				'label'	=> sprintf( esc_attr__( '%1$s Style Options', 'xinterio' ), $portfolio_cpt_singular_title ),
				'tab'	=> Controls_Manager::TAB_CONTENT,
			]
		);
		$this->add_control(
			'style',
			[
				'label'			=> sprintf( esc_attr__( 'Select %1$s View Style', 'xinterio' ), $portfolio_cpt_singular_title ),
				'description'	=> sprintf( esc_attr__( 'Select %1$s View Style', 'xinterio' ), $portfolio_cpt_singular_title ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '1',
				'options'		=> pbmit_element_template_list( 'portfolio', true ),
			]
		);
		$this->end_controls_section();
		// Column and Carousel Options
		$this->start_controls_section(
			'row_column_section',
			[
				'label'		=> esc_attr__( 'Column and Carousel Options', 'xinterio' ),
				'condition'	=> [
					'style!'	=> ['4','8','9','10'],
				],
			]
		);
		$this->add_control(
			'view-type',
			[
				'label'			=> sprintf( esc_attr__( 'How you like to view each %1$s box?', 'xinterio' ), $portfolio_cpt_singular_title ),
				'description'	=> esc_attr__( 'Show as carousel view, simple row-column view or masonry view.', 'xinterio' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> 'row-column',
				'options'		=> [
					'row-column'	=> esc_url( get_template_directory_uri() . '/includes/images/row-column.png' ),
					'carousel'		=> esc_url( get_template_directory_uri() . '/includes/images/carousel.png' ),
					'masonry'		=> esc_url( get_template_directory_uri() . '/includes/images/masonry.png' ),
				],
			]
		);
		// Carousel: Heading
		$this->add_control(
			'carousel_options',
			[
				'label'		=> esc_attr__( 'Carousel Options', 'xinterio' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
				'condition'	=> [
					'view-type'	=> 'carousel',
					'style!'	=> '4',
				],
			]
		);
		// Carousel : Autoplay
		$this->add_control(
			'carousel-autoplay',
			[
				'label'			=> esc_attr__( 'Carousel: Autoplay', 'xinterio' ),
				'description'	=> esc_attr__( 'Autoplay of carousel.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '1',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xinterio' ),
					'0'				=> esc_attr__( 'No', 'xinterio' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Carousel : delay
		$this->add_control(
			'carousel-delay',
			[
				'label'			=> esc_attr__( 'Carousel: delay', 'xinterio' ),
				'description'	=> esc_attr__( 'Slide hold time (in ms).', 'xinterio' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> '4000',
				'condition'		=> [
					'view-type'			=> 'carousel',
					'carousel-autoplay'	=> '1',
					'style!'			=> '4',
				],
			]
		);
		// Carousel : Loop
		$this->add_control(
			'carousel-loop',
			[
				'label'			=> esc_attr__( 'Carousel: Loop', 'xinterio' ),
				'description'	=> esc_attr__( 'Set to YES to enable continuous loop mode. Set NO to enable rewind loop mode.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '1',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xinterio' ),
					'0'				=> esc_attr__( 'No', 'xinterio' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Carousel : Center
		$this->add_control(
			'carousel-center',
			[
				'label'			=> esc_attr__( 'Carousel: Center', 'xinterio' ),
				'description'	=> esc_attr__( 'Center item. Works well with even an odd number of items.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xinterio' ),
					'0'				=> esc_attr__( 'No', 'xinterio' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Carousel : Nav
		$this->add_control(
			'carousel-nav',
			[
				'label'			=> esc_attr__( 'Carousel: Nav', 'xinterio' ),
				'description'	=> esc_attr__( 'Show next/prev buttons.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xinterio' ),
					'0'				=> esc_attr__( 'No', 'xinterio' ),
					'above'			=> esc_attr__( 'Yes, near heading area', 'xinterio' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Carousel : Dots
		$this->add_control(
			'carousel-dots',
			[
				'label'			=> esc_attr__( 'Carousel: Dots', 'xinterio' ),
				'description'	=> esc_attr__( 'Show dots navigation.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xinterio' ),
					'0'				=> esc_attr__( 'No', 'xinterio' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Carousel : Speed
		$this->add_control(
			'carousel-speed',
			[
				'label'			=> esc_attr__( 'Carousel:Speed', 'xinterio' ),
				'description'	=> esc_attr__( 'Slider animation time (in ms.)', 'xinterio' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> '3000',
				'condition'		=> [
					'view-type'		=> 'carousel',
					'style!'		=> '4',
				],
			]
		);
		// Infinite scroll
		$this->add_control(
			'infinite-scroll-section-heading',
			[
				'label'			=> esc_attr__( 'Infinite Scroll Options', 'xinterio' ),
				'type'			=> Controls_Manager::HEADING,
				'separator'		=> 'before',
				'condition'		=> [
					'view-type'		=> 'masonry',
				],
			]
		);
		$this->add_control(
			'infinite-scroll',
			[
				'label'			=> esc_attr__( 'Enable infinite scroll ?', 'xinterio' ),
				'description'	=> sprintf(esc_attr__( 'Select YES to dynamically load more %1$s', 'xinterio' ), $portfolio_cpt_title ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'view-type'		=> 'masonry',
				],
			]
		);
		$this->add_control(
			'infinite-scroll-show-loadmore-type',
			[
				'label'		=> esc_attr__( 'Load new boxes', 'xinterio' ),
				'type'		=> Controls_Manager::SELECT,
				'options'	=> [
					'auto'		=> esc_attr( 'On page scroll (auto)' ),
					'button'	=> esc_attr( 'On button click' ),
				],
				'condition'		=> [
					'view-type'			=> 'masonry',
					'infinite-scroll'	=> 'yes',
				],
				'default'	=> esc_attr( 'auto' ),
			]
		);
		$this->add_control(
			'infinite-scroll-loadmore-btn-title',
			[
				'label'			=> esc_attr__( 'Button text', 'xinterio' ),
				'description'	=> esc_attr__( 'Button title for the "Load More" button.', 'xinterio' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'condition' 	=> [
					'infinite-scroll-show-loadmore-type'	=> 'button',
					'infinite-scroll'						=> 'yes',
					'view-type'								=> 'masonry',
				],
				'default'		=> esc_attr__( 'Load More', 'xinterio' ),
				'placeholder'	=> esc_attr__( 'Enter button title', 'xinterio' ),
				'label_block'	=> true,
			]
		);
		// Columns
		$this->add_control(
			'view-column-section-heading',
			[
				'label'			=> esc_attr__( 'Column Settings', 'xinterio' ),
				'type'			=> Controls_Manager::HEADING,
				'separator'		=> 'before',
				'condition'		=> [
				]
			]
		);
		$this->add_control(
			'columns',
			[
				'label'			=> esc_attr__( 'View in Column', 'xinterio' ),
				'description'	=> esc_attr__( 'Select how many column to show.', 'xinterio' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '3',
				'options'		=> [
					'1'				=> esc_url( get_template_directory_uri() . '/includes/images/column-1.png' ),
					'2'				=> esc_url( get_template_directory_uri() . '/includes/images/column-2.png' ),
					'3'				=> esc_url( get_template_directory_uri() . '/includes/images/column-3.png' ),
					'4'				=> esc_url( get_template_directory_uri() . '/includes/images/column-4.png' ),
				],
			]
		);
		$this->end_controls_section();
		// Heading Animation
		$this->start_controls_section(
			'Heading_animation_section',
			[
				'label'		=> esc_attr__( 'Heading Animation Option', 'xinterio' ),
				'condition'	=>	[
					'style'	=>	'9',
				],
			]
		);
		$this->add_control(
			'first_title',
			[
				'label'			=> esc_attr__( 'First Heading', 'xinterio' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Latest', 'xinterio' ),
				'placeholder'	=> esc_attr__( 'Enter your First heading', 'xinterio' ),
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'ani_image',
			[
				'label'		=> esc_attr( 'Choose Animation Image', 'xinterio' ),
				'type'		=> Controls_Manager::MEDIA,
				'dynamic'	=> [
					'active'	=> true,
				],
				'default'	=> [
					'url'		=> get_template_directory_uri() . '/images/ani_img.png',
				],
			]
		);
		$this->add_control(
			'second_title',
			[
				'label'			=> esc_attr__( 'Second Heading', 'xinterio' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Works', 'xinterio' ),
				'placeholder'	=> esc_attr__( 'Enter your Second heading', 'xinterio' ),
				'label_block'	=> true,
			]
		);
		$this->end_controls_section();
		// Heading and Subheading
		$this->start_controls_section(
			'heading_section',
			[
				'label'		=> esc_attr__( 'Heading and Subheading', 'xinterio' ),
				'condition'	=>	[
					'style!'	=>	'9',
				],
			]
		);
		$this->add_control(
			'hs_style',
			[
				'label'			=> esc_attr__( 'Select Heading/Subheading Style', 'xinterio' ),
				'description'	=> esc_attr__( 'Select Heading/Subheading Style', 'xinterio' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '1',
				'options'		=> array(
					'1'				=> get_template_directory_uri() . '/includes/images/heading-subheading-style-1.jpg',
					'2'				=> get_template_directory_uri() . '/includes/images/heading-subheading-style-2.jpg',
				),
			]
		);
		$this->add_control(
			'title_animation',
			[
				'label'			=> esc_attr__( 'Heading Animation', 'xinterio' ),
				'description'	=> esc_attr__( 'Select Heading Text Animation View style.', 'xinterio' ) . ' ' . pbmit_esc_kses('<br><a target="_blank" href="' . esc_url('https://xinterio-demo.pbminfotech.com/demo1/element/#heading-animations') . '">' . esc_attr__( 'See all anmiation demo here.', 'xinterio' ) . '</a>' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '4',
				'options'		=> [
					'4'				=> esc_attr__( 'No animation', 'xinterio' ),
					'1'				=> esc_attr__( 'Animation Style 1', 'xinterio' ),
					'2'				=> esc_attr__( 'Animation Style 2', 'xinterio' ),
					'3'				=> esc_attr__( 'Animation Style 3', 'xinterio' ),
				],
				'separator'		=> 'before',
			]
		);
		$this->add_control(
			'title',
			[
				'label'			=> esc_attr__( 'Heading', 'xinterio' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> sprintf( esc_attr__( 'Our %1$s', 'xinterio' ), $portfolio_cpt_singular_title ),
				'placeholder'	=> esc_attr__( 'Enter your heading', 'xinterio' ),
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'title_link',
			[
				'label'			=> esc_attr__( 'Heading Link', 'xinterio' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'subtitle',
			[
				'label'			=> esc_attr__( 'Subheading', 'xinterio' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'placeholder'	=> esc_attr__( 'Enter your subtitle', 'xinterio' ),
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'subtitle_link',
			[
				'label'			=> esc_attr__( 'Subheading Link', 'xinterio' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'desc',
			[
				'label'			=> esc_attr__( 'Description', 'xinterio' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'placeholder'	=> esc_attr__( 'Type your description here', 'xinterio' ),
			]
		);
		$this->add_control(
			'reverse_title',
			[
				'label'			=> esc_attr__( 'Reverse Heading', 'xinterio' ),
				'description'	=> esc_attr__( 'Show Subheading before Heading', 'xinterio' ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'hs_style!'			=>	['2'],
				],
			]
		);
		// Button
		$this->add_control(
			'button_options',
			[
				'label'			=> esc_attr__( 'Button Options', 'xinterio' ),
				'type'			=> Controls_Manager::HEADING,
				'separator'		=> 'before',
				'condition'		=> [
					'style'			=> '7',
				],
			]
		);
		$this->add_control(
			'btn_title',
			[
				'label'			=> esc_attr__( 'Button Title', 'xinterio' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Read More', 'xinterio' ),
				'placeholder'	=> esc_attr__( 'Enter button title here', 'xinterio' ),
				'label_block'	=> true,
				'condition'		=> [
					'style'			=> '7',
				],
			]
		);
		$this->add_control(
			'btn_link',
			[
				'label'			=> esc_attr__( 'Button Link', 'xinterio' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
				'condition'		=> [
					'style'			=> '7',
				],
				'default'		=> array (
					'url'				=> '#',
					'is_external'		=> '',
					'nofollow'			=> '',
					'custom_attributes'	=> '',
				),
			]
		);
		$this->add_responsive_control(
			'text_align',
			[
				'label'			=> esc_attr__( 'Alignment', 'xinterio' ),
				'type'			=> Controls_Manager::CHOOSE,
				'options'		=> [
					'left'			=> [
						'title'			=> esc_attr__( 'Left', 'xinterio' ),
						'icon'			=> 'fa fa-align-left',
					],
					'center'		=> [
						'title'			=> esc_attr__( 'Center', 'xinterio' ),
						'icon'			=> 'fa fa-align-center',
					],
					'right'			=> [
						'title'			=> esc_attr__( 'Right', 'xinterio' ),
						'icon'			=> 'fa fa-align-right',
					],
				],
				'prefix_class'	=> 'pbmit-ele-header-align-',
				'selectors'		=> [
					'{{WRAPPER}} .pbmit-heading-subheading' => 'text-align: {{VALUE}};',
				],
				'condition'		=> [
					'hs_style!'			=>	['2'],
				],
			]
		);
		$this->end_controls_section();
		// Content Options
		$this->start_controls_section(
			'data_section',
			[
				'label' => sprintf( esc_attr__( '%1$s Content Options', 'xinterio' ), $portfolio_cpt_singular_title ),
			]
		);
		$this->add_control(
			'from_category',
			[
				'label'			=> sprintf( esc_attr__( 'Show %2$s from selected %2$s?', 'xinterio' ), $portfolio_cpt_singular_title, $portfolio_cat_singular_title ),
				'type'			=> Controls_Manager::SELECT2,
				'options'		=> $this->select_category(),
				'multiple'		=> true,
				'label_block'	=> true,
				'placeholder'	=> esc_attr__( 'All Categories', 'xinterio' ),
			]
		);
		$this->add_control(
			'show',
			[
				'label'			=> sprintf( esc_attr__( '%1$s to show', 'xinterio' ), $portfolio_cpt_singular_title ),
				'description'	=> sprintf( esc_attr__( 'How many %1$s you want to show.', 'xinterio' ), $portfolio_cpt_singular_title ),
				'separator'		=> 'before',
				'type'			=> Controls_Manager::NUMBER,
				'default'		=> '6',
			]
		);
		$this->add_control(
			'sortable',
			[
				'label'			=> sprintf( esc_attr__( 'Show Sortable %1$s?', 'xinterio' ), $portfolio_cat_singular_title ),
				'description'	=> sprintf( esc_attr__( 'Select YES to show sortable %1$s.', 'xinterio' ), $portfolio_cat_singular_title ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'view-type'		=> 'row-column',
					'pagination!'	=> 'yes',
					'style!'		=> ['4','8'],
				],
			]
		);
		$this->add_control(
			'ajax_sortable',
			[
				'label'			=> esc_attr__( 'Ajax based sortable Category?', 'xinterio' ),
				'description'	=> sprintf( esc_attr__( 'Select YES to load %1$s using Ajax on click on the category.', 'xinterio' ), $portfolio_cat_singular_title ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'view-type'		=> 'row-column',
					'sortable'		=> 'yes',
					'offset!'		=> 'yes',
					'style!'		=>	['4','8'],
				],
			]
		);
		$this->add_control(
			'pagination',
			[
				'label'			=> esc_attr__( 'Show Pagination ?', 'xinterio' ),
				'description'	=>  sprintf( esc_attr__( 'Select YES to Show pagination links below %1$s boxes.', 'xinterio' ), $portfolio_cat_singular_title  ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'view-type'		=> 'row-column',
					'sortable!'		=> 'yes',
					'style!'		=> ['4','6','8'],
				]
			]
		);
		$this->add_control(
			'ajax_pagination',
			[
				'label'			=> esc_attr__( 'Load post without page refresh on Pagination click ?', 'xinterio' ),
				'description'	=>  sprintf( esc_attr__( 'Select YES to load Posts without page refresh (ajax based) when click on the pagination links.', 'xinterio' ), $portfolio_cat_singular_title  ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xinterio' ),
				'label_off'		=> esc_attr__( 'No', 'xinterio' ),
				'return_value'	=> 'yes',
				'default'		=> '',
				'condition'		=> [
					'pagination'	=> 'yes',
					'view-type'		=> 'row-column',
					'sortable!'		=> 'yes',
					'style!'		=> ['4','6','8'],
				]
			]
		);
		$this->add_control(
			'order',
			[
				'label'			=> esc_attr__( 'Order', 'xinterio' ),
				'description'	=> esc_attr__( 'Designates the ascending or descending order.', 'xinterio' ),
				'type'			=> Controls_Manager::SELECT,
				'separator'		=> 'before',
				'default'		=> 'DESC',
				'options'		=> [
					'ASC'			=> esc_attr__( 'Ascending order (1, 2, 3; a, b, c)', 'xinterio' ),
					'DESC'			=> esc_attr__( 'Descending order (3, 2, 1; c, b, a)', 'xinterio' ),
				]
			]
		);
		$this->add_control(
			'orderby',
			[
				'label'			=> esc_attr__( 'Order By', 'xinterio' ),
				'description'	=> sprintf( esc_attr__( ' Sort retrieved %1$s by parameter.', 'xinterio' ), $portfolio_cpt_singular_title ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> 'none',
				'options'		=> [
					'none'			=> esc_attr__( 'No order', 'xinterio' ),
					'ID'			=> esc_attr__( 'ID', 'xinterio' ),
					'title'			=> esc_attr__( 'Title', 'xinterio' ),
					'date'			=> esc_attr__( 'Date', 'xinterio' ),
					'rand'			=> esc_attr__( 'Random', 'xinterio' ),
				]
			]
		);
		$this->add_control(
			'offset',
			[
				'label'			=> sprintf( esc_attr__( 'Skip %1$s (offset)', 'xinterio' ), $portfolio_cpt_singular_title ),
				'description'	=> sprintf( esc_attr__( 'How many %1$s you like to skip.', 'xinterio' ), $portfolio_cpt_singular_title ),
				'type'			=> Controls_Manager::SELECT,
				'label_block'	=> true,
				'default'		=> '',
				'options'		=> [
					''			=> sprintf( esc_attr__( 'Show All %1$s (No skip)', 'xinterio' ), $portfolio_cpt_singular_title ),
					'1'			=> sprintf( esc_attr__( 'Skip first %1$s', 'xinterio' ), $portfolio_cpt_singular_title ),
					'2'			=> sprintf( esc_attr__( 'Skip two %1$s', 'xinterio' ), $portfolio_cpt_title ),
					'3'			=> sprintf( esc_attr__( 'Skip three %1$s', 'xinterio' ), $portfolio_cpt_title ),
					'4'			=> sprintf( esc_attr__( 'Skip four %1$s', 'xinterio' ), $portfolio_cpt_title ),
					'5'			=> sprintf( esc_attr__( 'Skip five %1$s', 'xinterio' ), $portfolio_cpt_title ),
				],
				'condition'	=> [
					'pagination!'		=> 'yes',
					'ajax_pagination!'	=> 'yes',
					'ajax_sortable!' 	=> 'yes',
				]
			]
		);
		$this->end_controls_section();
		// HTML Tags
		$this->start_controls_section(
			'advanced_section',
			[
				'label'	=> pbmit_esc_kses('<img class="pbmit-tab-small-logo" src="'.get_template_directory_uri() . '/includes/images/pbm-small-logo.png" /> ') . esc_attr__( 'Tag & Gap Settings', 'xinterio' ),
				'tab'	=> Controls_Manager::TAB_ADVANCED,
			]
		);
		$this->add_control(
			'tag_options',
			[
				'label'		=> esc_attr__( 'Tags for SEO', 'xinterio' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'title_tag',
			[
				'label'		=> esc_attr__( 'Heading Tag', 'xinterio' ),
				'type'		=> Controls_Manager::SELECT,
				'options'	=> [
					'h1'		=> esc_attr( 'H1' ),
					'h2'		=> esc_attr( 'H2' ),
					'h3'		=> esc_attr( 'H3' ),
					'h4'		=> esc_attr( 'H4' ),
					'h5'		=> esc_attr( 'H5' ),
					'h6'		=> esc_attr( 'H6' ),
					'div'		=> esc_attr( 'DIV' ),
				],
				'default'	=> esc_attr( 'h2' ),
			]
		);
		$this->add_control(
			'subtitle_tag',
			[
				'label'		=> esc_attr__( 'Subheading Tag', 'xinterio' ),
				'type'		=> Controls_Manager::SELECT,
				'options'	=> [
					'h1'		=> esc_attr( 'H1' ),
					'h2'		=> esc_attr( 'H2' ),
					'h3'		=> esc_attr( 'H3' ),
					'h4'		=> esc_attr( 'H4' ),
					'h5'		=> esc_attr( 'H5' ),
					'h6'		=> esc_attr( 'H6' ),
					'div'		=> esc_attr( 'DIV' ),
				],
				'default' => esc_attr( 'h4' ),
			]
		);
		$this->add_control(
			'gap_options',
			[
				'label'		=> sprintf( esc_attr__( 'Gap between %1$s boxes', 'xinterio' ), $portfolio_cpt_singular_title ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
				'condition'	=> [
					'style!'	=> ['4','9'],
				],
			]
		);
		$this->add_control(
			'gap',
			[
				'label'			=> esc_attr__( 'Box Gap', 'xinterio' ),
				'description'	=>  sprintf( esc_attr__( 'Gap between each %1$s box.', 'xinterio' ), $portfolio_cpt_singular_title ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> 'default',
				'options'		=> [
					'default'		=> esc_attr__( 'Default Gap', 'xinterio' ),
					'0px'			=> esc_attr__( 'No Gap (0px)', 'xinterio' ),
					'5px'			=> esc_attr__( '5px', 'xinterio' ),
					'10px'			=> esc_attr__( '10px', 'xinterio' ),
					'15px'			=> esc_attr__( '15px', 'xinterio' ),
					'20px'			=> esc_attr__( '20px', 'xinterio' ),
					'25px'			=> esc_attr__( '25px', 'xinterio' ),
					'30px'			=> esc_attr__( '30px', 'xinterio' ),
					'35px'			=> esc_attr__( '35px', 'xinterio' ),
					'40px'			=> esc_attr__( '40px', 'xinterio' ),
					'45px'			=> esc_attr__( '45px', 'xinterio' ),
					'50px'			=> esc_attr__( '50px', 'xinterio' ),
				],
				'condition'	=> [
					'style!'	=> ['4','9'],
				],
			]
		);
		$this->end_controls_section();
	}
	protected function render() {
		$settings	= $this->get_settings_for_display();
		extract($settings);
		// check variables
		$columns = ( !empty($columns) ) ? $columns : '1' ;
		// Masonry image sizes
		$masonry_image_size_array = array(
			'pbmit-img-770x492', // For masonry 1st box
			'pbmit-img-770x762', // For masonry 2nd box
			'pbmit-img-770x492', // For masonry 3rd box
			'pbmit-img-770x745', // For masonry 4th box
			'pbmit-img-770x745', // For masonry 5th box
			'pbmit-img-770x872', // For masonry 6th box
			'pbmit-img-770x447', // For masonry 7th box
			'pbmit-img-770x485', // For masonry 8th box
			'pbmit-img-770x974', // For masonry 9th box
		);
		if( $style == '2' && $settings['view-type'] =='carousel'){
			$masonry_image_size_array = array(
				'pbmit-img-890x740', // For masonry 1st box
				'pbmit-img-890x990', // For masonry 2nd box
			);
		} 
		if( $style == '6' && $settings['view-type'] =='carousel'){
			$masonry_image_size_array = array(
				'pbmit-img-401x334', // For masonry 1st box
				'pbmit-img-401x488', // For masonry 2nd box
				'pbmit-img-401x488', // For masonry 3th box
				'pbmit-img-401x334', // For masonry 4st box
			);
		}
		if( $style == '9'){
			$masonry_image_size_array = array(
				'pbmit-img-555x395', // For masonry 1st box
				'pbmit-img-670x435', // For masonry 2nd box
				'pbmit-img-910x490', // For masonry 3rd box
			);
		} 
		$swiper_class = '';
		if( isset($data['settings']["view-type"]) && !empty($data['settings']["view-type"]) && $data['settings']["view-type"]=='carousel' ){
			$swiper_class = ' swiper-wrapper';
		}
		$infinite_scroll_enabled = ( isset($settings['infinite-scroll']) && !empty($settings['infinite-scroll']) ) ? $settings['infinite-scroll'] : 'no' ;
		$loadmore_btn = ( isset($settings['infinite-scroll-show-loadmore-type']) && !empty($settings['infinite-scroll-show-loadmore-type']) ) ? $settings['infinite-scroll-show-loadmore-type'] : 'no' ;
		$loadmore_btn_title = ( isset($settings['infinite-scroll-loadmore-btn-title']) && !empty($settings['infinite-scroll-loadmore-btn-title']) ) ? $settings['infinite-scroll-loadmore-btn-title'] : '' ;
		?>
		<?php
		// Starting container
		pbmit_element_container( array(
			'position'	=> 'start',
			'cpt'		=> 'portfolio',
			'data'		=> $settings
		) );
		?>
		<?php if($style =='4'){?> <div class="row"><div class="container"><?php } ?>
			<?php if($style !== '6' && $style !== '7' ){?>
				<div class="pbmit-ele-header-area">
					<?php pbmit_heading_subheading($settings, true); ?>
					<?php
					/* Sortable Category  */
					$sortable_html = pbmit_sortable_category( $settings, 'pbmit-portfolio-category' );
					if( !empty($sortable_html) ){
						echo  pbmit_esc_kses( $sortable_html );
					}
					?>
				</div>
			<?php } ?>
		<?php if($style == '4'){?></div></div><?php } ?>
		<?php
		// Infinite scroll data
		$infinite_scroll_data = array();
		$infinite_scroll_data['cpt'] = 'portfolio';
		$infinite_scroll_data['style'] = $style;
		if( !empty($settings['columns']) ){
			$infinite_scroll_data['columns'] = $settings['columns'];
		}
		if( !empty($settings['show']) ){
			$infinite_scroll_data['show'] = $settings['show'];
		}
		if( !empty($settings['offset']) ){
			$infinite_scroll_data['offset'] = $settings['offset'];
		}
		if( !empty($settings['from_category']) ){
			$infinite_scroll_data['from_category'] = $settings['from_category'];
		}
		if( !empty($settings['show']) ){
			$infinite_scroll_data['show'] = $settings['show'];
		}
		if( !empty($settings['order']) ){
			$infinite_scroll_data['order'] = $settings['order'];
		}
		if( !empty($settings['orderby']) ){
			$infinite_scroll_data['orderby'] = $settings['orderby'];
		}
		echo pbmit_esc_kses('<div class="pbmit-infinite-scroll-data">'.json_encode($infinite_scroll_data).'</div>');
		// Preparing $args
		if(is_front_page()) {
			$paged = (get_query_var('page')) ? get_query_var('page') : 1;
		}else {
			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
		}
		$args = array(
			'post_type'				=> 'pbmit-portfolio',
			'status'				=> 'publish',
			'posts_per_page'		=> $show,
			'ignore_sticky_posts'	=> true,
			'paged' => $paged,
		);
		if( !empty($offset) ){
			$args['offset'] = $offset;
		}
		if( !empty($orderby) && $orderby!='none' ){
			$args['orderby'] = $orderby;
			if( !empty($order) ){
				$args['order'] = $order;
			}
		}
		// From selected category/group
		if( !empty($from_category) ){
			$args['tax_query'] = array(
				array(
					'taxonomy'	=> 'pbmit-portfolio-category',
					'field'		=> 'slug',
					'terms'		=> $from_category,
				),
			);
		};
		// Wp query to fetch posts
		$posts = new \WP_Query( $args );
		if ( $posts->have_posts() ) {
			$total_posts = $posts->found_posts;
			?>
		<?php if ($style == '7'){?>
			<div class="row">
				<div class ="col-md-10 col-sm-12 pbmit-portfolio-post-wrapper">
			<?php  } ?>
		<?php if ($style == '6'){?>
			<div class="row">
				<div class ="col-md-3">
					<div class="pbmit-ele-header-area">
						<?php pbmit_heading_subheading($settings, true); ?>
					</div>
				</div>
				<div class ="col-md-9">
			<?php  } ?>
				<div class="pbmit-element-posts-wrapper row multi-columns-row <?php if( !empty($settings['view-type']) && trim($settings['view-type'])=='carousel' ){ ?><?php if($style !=='4'){?>swiper-container<?php } ?><?php } ?>" >
					<?php if( $style == '4'){ ?>
						<div class="pbmit-main-hover-faded">
							<div class="pbmit-content-box">
								<div class= "swiper-container swiper-hover-slide-nav">
									<div class="swiper-wrapper">
										<?php
										while ( $posts->have_posts() ) {
											$posts->the_post();
											?>
											<div class="swiper-slide">
												<div class="pbmit-content-box-inner">
													<div class="pbmit-titlebox-wrap">
														<div class="pbmit-titlebox">
															<div class="pbmit-port-cat"><?php echo get_the_term_list( get_the_ID(), 'pbmit-portfolio-category', '', ', ' ); ?></div>
															<h3 class="pbmit-portfolio-title"><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></h3>
														</div>
														<div class="pbmit-portfolio-btn">
															<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Go to %1$s','xinterio'), get_the_title() ); ?>"><i class="pbmit-base-icon-pbmit-up-arrow"></i></a>
														</div>
													</div>
												</div>
											</div>
										<?php } ?>
									</div>
								</div>
							</div>
							<div class="swiper-hover-slide-images">
								<div class="swiper-container pbmit-hover-image-faded">
									<div class="swiper-wrapper">
										<?php
										while ( $posts->have_posts() ) {
											$posts->the_post();?>
											<div class="swiper-slide">
												<?php pbmit_get_featured_data( array( 'featured_img_only' => true, 'size' => 'pbmit-img-1920x700' ) ); ?>
											</div>
										<?php } ?>
									</div>
								</div>
							</div>
						</div>  <!-- end of pbmit-main-hover-faded -->
						<div class="swiper-button-prev"></div>
						<div class="swiper-button-next"></div>
						<?php } elseif( $style == '9' ){
							// Media image
							$ani_image_html	= $first_heading_html = $second_heading_html = '' ;
							if( !empty($settings['ani_image']) ){
								$ani_image_html = '<img src="'.$settings['ani_image']['url'].'" alt="'.esc_attr($settings['first_title']).'" />';
							}					
							// Fisrt text
							if( !empty($settings['first_title']) ){
								$first_heading_html = pbmit_esc_kses($settings['first_title']);
							}
							// Fisrt text
							if( !empty($settings['second_title']) ){
								$second_heading_html = pbmit_esc_kses($settings['second_title']);
							}
							?>
							<div class="pbmit-heading-animation">
								<div class="pbmit-heading-text1"><h3><?php echo pbmit_esc_kses( $first_heading_html ); ?>
									<span class="pbmit-ani-image"><?php echo pbmit_esc_kses( $ani_image_html ); ?></span>
									<?php echo pbmit_esc_kses( $second_heading_html ); ?></h3>
								</div>							
							</div>
							<?php
							$counter = 0;
							while ( $posts->have_posts() ) {
								$return = '';
								$posts->the_post();
								$imgsize = $masonry_image_size_array[ $counter % 3 ];
								// 2 posts in top group
								if ( $counter % 3 == 0 || $counter % 3 == 1 ) {
									if ( $counter % 3 == 0 ) { ?>
										<div class="pbmit-portfolio-group-top col-md-12"><div class="row">
									<?php } ?>
									<div class="pbmit-group-top col-md-6">
										<?php
										// Template
										if( file_exists( locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false ) ) ){
											$return .= pbmit_element_block_container( array(
												'position' => 'start',
												'column'   => $columns,
												'cpt'	  => 'portfolio',
												'taxonomy' => 'pbmit-portfolio-category',
												'style'	=> $style,
											) );
											ob_start();
											include locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false );
											$return .= ob_get_clean();
											$return .= pbmit_element_block_container( array( 'position' => 'end' ) );
										}
										echo pbmit_esc_kses($return);
										?>
									</div>
									<?php
									// Close top group after the second post
									if ( $counter % 3 == 1 ) { ?>
										</div></div>
									<?php }
								}
								// only One post in center group
								elseif ( $counter % 3 == 2 ) { ?>
									<div class="pbmit-portfolio-group-center col-md-12">
										<?php // Template
										if( file_exists( locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false ) ) ){
											$return .= pbmit_element_block_container( array(
												'position' => 'start',
												'column'   => $columns,
												'cpt'	  => 'portfolio',
												'taxonomy' => 'pbmit-portfolio-category',
												'style'	=> $style,
											) );
											ob_start();
											include locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false );
											$return .= ob_get_clean();
											$return .= pbmit_element_block_container( array( 'position' => 'end' ) );
										}
										echo pbmit_esc_kses($return); ?>
									</div>
								<?php }
								$counter++; // Increment counter
							} 
						} elseif( $style == '10' ){ ?>
							<div class="swiper">
								<div class="swiper-wrapper">
									<?php while ( $posts->have_posts() ) {
									$posts->the_post();
									$imgsize =  "";
									if( empty($imgsize)){ $imgsize = 'pbmit-img-800x570';  }
									$img_src = '';
										if ( has_post_thumbnail( get_the_ID() ) ) {
											$img_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID()), 'full' );
										};
									?>
									<div class="swiper-slide">
										<div class="pbminfotech-post-content">
											<?php pbmit_get_featured_data( array( 'featured_img_only' => true, 'size' => esc_attr($imgsize) ) ); ?>
											<div class="pbminfotech-box-content">
												<div class="pbminfotech-titlebox">
													<div class="pbmit-port-cat"><?php echo get_the_term_list( get_the_ID(), 'pbmit-portfolio-category', '', ', ' ); ?></div>
													<h3 class="pbmit-portfolio-title"><a href="<?php the_permalink(); ?>"><?php echo esc_html(get_the_title()); ?></a></h3>
												</div>
											</div>
										</div>
									</div>
									<?php } ?>
								</div>
							</div>
							<div class="swiper-button-prev"></div>
							<div class="swiper-button-next"></div>
					<?php } else { 
					$odd_even		= 'odd';
					$col_odd_even	= 'odd';
					$x				= 1;
					$every_three	= 1; // Specially for portfolio style 14
					$pbmit_global_sc_loop_inner_count = 0;
					while ( $posts->have_posts() ) {
						$return = '';
						$posts->the_post();
						// masonry image size
						$imgsize = ''; // default image size variable. This should be empty.
						if( !empty($settings['view-type']) && $settings['view-type'] == 'masonry' ){
							$imgsize = $masonry_image_size_array[($pbmit_global_sc_loop_inner_count)];
						}
						// carousel image size
						if( $style == '2' || $style == '6'){
							if( !empty($settings['view-type']) && $settings['view-type'] == 'carousel'){
								$imgsize = ''; // default image size variable. This should be empty.
								$imgsize = $masonry_image_size_array[($pbmit_global_sc_loop_inner_count)];
							}
						}
						// Template
						if( file_exists( locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false ) ) ){
							$return .= pbmit_element_block_container( array(
								'position'		=> 'start',
								'column'		=> $columns,
								'cpt'			=> 'portfolio',
								'taxonomy'		=> 'pbmit-portfolio-category',
								'style'			=> $style,
								'odd_even'		=> $odd_even,
								'col_odd_even'	=> $col_odd_even,
							) );
							ob_start();
							include( locate_template( '/theme-parts/portfolio/portfolio-style-'.esc_attr($style).'.php', false, false ) );
							$return .= ob_get_contents();
							ob_end_clean();
							$return .= pbmit_element_block_container( array(
								'position'	=> 'end',
							) );
							// Variable to count current, for image size and other use
							$pbmit_global_sc_loop_inner_count++;
							if( !empty($masonry_image_size_array) ){
								if (($x) % (count($masonry_image_size_array)) == 0) {
									$pbmit_global_sc_loop_inner_count = 0;
								}
							}
						}
						// Specially for portfolio style6
						if( $style == '6' ){
							if( !empty($settings['view-type']) && trim($settings['view-type'])=='carousel' ){
								if( $every_three == 1 || $every_three == 3 ){
									echo pbmit_esc_kses('<div class="pbmit-ele-group-wrapper">');
								}
							}
						}
						echo pbmit_esc_kses($return);
						// specially for portfolio style6
						if( $style == '6' ){
							if( !empty($settings['view-type']) && trim($settings['view-type'])=='carousel' ){
								if( $every_three == 2 || $every_three == 3 || $x == $total_posts ){
									echo pbmit_esc_kses('</div>');
								}
							}
						}
						// odd or even
						if( $odd_even == 'odd' ){ $odd_even = 'even'; } else { $odd_even = 'odd'; }
						if( !empty($columns) ){
							if( $x % $columns == 0 ){
								if( $col_odd_even == 'odd' ){ $col_odd_even = 'even'; } else { $col_odd_even = 'odd'; }
							}
						}
						// specially for portfolio style 2
						if( $every_three == 2){
							$every_three = 1;
						} else {
							$every_three++;
						}
						$x++;
					} }
					if( $style == '6'){ ?> </div></div> <?php }
					if( $style == '7'){ ?> </div></div>
						<div class ="col-md-2 col-sm-12 pbmit-portfolio-heading-wrapper">
							<div class="pbmit-ele-header-area">
								<?php pbmit_heading_subheading($settings, true); ?>
							</div>
							<?php // Button
							if( !empty($settings['btn_title']) && !empty($settings['btn_link']['url']) ){
								$button_html = '<div class="pbmit-portfolio-btn">' . pbmit_link_render($settings['btn_link'], 'start' ) . pbmit_esc_kses($settings['btn_title']) . pbmit_link_render($settings['btn_link'], 'end' ) . '</div>';
							} 
							echo pbmit_esc_kses( $button_html ); ?>
						</div>
					<?php } ?>
			</div>
			<?php
			// Pagination
			if( isset($settings['pagination']) && $settings['pagination']=='yes' && $settings['view-type']!='carousel' ){
				$return .= pbmit_pagination( $posts );
			}
			?>
			<?php
			// infinite scroll
			if( $infinite_scroll_enabled=='yes' ){
				// Load More button
				if( $loadmore_btn == 'button' ){
					if( empty($loadmore_btn_title) ){
						$loadmore_btn_title = esc_attr__( 'Load More', 'xinterio' );
					}
					echo pbmit_esc_kses( '<div class="pbmit-ajax-load-more-btn"><a href="#">' . esc_attr($loadmore_btn_title) . '</a></div>' );
				}
				echo pbmit_esc_kses( '<div class="pbmit-infinite-loader"><img src="' . get_template_directory_uri() . '/images/three-dots.svg" width="60" alt="' . esc_attr__( 'Loader', 'xinterio' ) . '"></div><div class="pbmit-infinite-scroll-last">' . esc_attr__( 'All content loaded', 'xinterio' ) . '</div>' );
			}
			?>
		<?php } else { ?>
			<div class="pbmit-no-data-message"><?php esc_html_e('No data available.', 'xinterio'); ?></div>
		<?php }
		wp_reset_postdata();
		// Ending wrapper of the whole arear
		pbmit_element_container( array(
			'position'	=> 'end',
			'cpt'		=> 'portfolio',
			'data'		=> $settings
		) );
	}
	protected function content_template() {}
	protected function select_category() {
		$category = get_terms( array( 'taxonomy' => 'pbmit-portfolio-category', 'hide_empty' => false ) );
		$cat = array();
		foreach( $category as $item ) {
			$cat_count = get_category( $item );
			if( $item ) {
				$cat[$item->slug] = $item->name . ' ('.$cat_count->count.')';
			}
		}
		return $cat;
	}
}
// After the Schedule class is defined, I must register the new widget class with Elementor:
Plugin::instance()->widgets_manager->register( new PBMIT_PortfolioElement() );
