🚀 Hostinger Optimized
🖥️ Server: Apache
💻 System: Linux webm015.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
👤 User: stakrfrcol (69043)
🐘 PHP: 8.3.31
🚫 Disabled: _dyuweyrj4,_dyuweyrj4r,dl

💻 Terminal

📁 /home/stakrfrcol/agency
$

📄 jobs.php

📁 Path: ./wp-content/themes/xhyre/includes/elementor/jobs.php
📊 Size: 16.51 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?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_JobsElement 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_jobs_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() {
		return esc_attr__( 'Xhyre Jobs Element', 'xhyre' );
	}
	// 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 [ 'xhyre_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' );
		}
	}
	protected function register_controls() {
		// Style
		$this->start_controls_section(
			'style_section',
			[
				'label' => esc_attr__( 'Select Style', 'xhyre' ),
				'tab'	=> Controls_Manager::TAB_CONTENT,
			]
		);
		$this->add_control(
			'style',
			[
				'label'			=> esc_attr__( 'Select Jobs View Style', 'xhyre' ),
				'description'	=> esc_attr__( 'Select Jobs View style.', 'xhyre' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '1',
				'options'		=> pbmit_element_template_list( 'jobs', true ),
			]
		);
		$this->end_controls_section();
		// Appearance
		$this->start_controls_section(
			'row_column_section',
			[
				'label' => esc_attr__( 'Column and Carousel Options', 'xhyre' ),
			]
		);
		$this->add_control(
			'view-type',
			[
				'label'			=> esc_attr__( 'How you like to view each Post box?', 'xhyre' ),
				'description'	=> esc_attr__( 'Show as carousel view or simple row-column view.', 'xhyre' ),
				'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' ),
				]
			]
		);
		// Carousel: Heading
		$this->add_control(
			'carousel_options',
			[
				'label'		=> esc_attr__( 'Carousel Options', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
				'condition'	=> [
					'view-type'	=> 'carousel',
				],
			]
		);
		// Carousel : Autoplay
		$this->add_control(
			'carousel-autoplay',
			[
				'label'			=> esc_attr__( 'Carousel: Autoplay', 'xhyre' ),
				'description'	=> esc_attr__( 'Autoplay of carousel.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '1',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xhyre' ),
					'0'				=> esc_attr__( 'No', 'xhyre' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Carousel : delay
		$this->add_control(
			'carousel-delay',
			[
				'label'			=> esc_attr__( 'Carousel: delay', 'xhyre' ),
				'description'	=> esc_attr__( 'Slide hold time (in ms).', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> '4000',
				'condition'		=> [
					'view-type'			=> 'carousel',
					'carousel-autoplay'	=> '1',
				],
			]
		);
		// Carousel : Loop
		$this->add_control(
			'carousel-loop',
			[
				'label'			=> esc_attr__( 'Carousel: Loop', 'xhyre' ),
				'description'	=> esc_attr__( 'Set to YES to enable continuous loop mode. Set NO to enable rewind loop mode.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '1',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xhyre' ),
					'0'				=> esc_attr__( 'No', 'xhyre' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Carousel : Center
		$this->add_control(
			'carousel-center',
			[
				'label'			=> esc_attr__( 'Carousel: Center', 'xhyre' ),
				'description'	=> esc_attr__( 'Center item. Works well with even an odd number of items.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xhyre' ),
					'0'				=> esc_attr__( 'No', 'xhyre' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Carousel : Nav
		$this->add_control(
			'carousel-nav',
			[
				'label'			=> esc_attr__( 'Carousel: Nav', 'xhyre' ),
				'description'	=> esc_attr__( 'Show next/prev buttons.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xhyre' ),
					'0'				=> esc_attr__( 'No', 'xhyre' ),
					'above'			=> esc_attr__( 'Yes, near heading area', 'xhyre' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Carousel : Dots
		$this->add_control(
			'carousel-dots',
			[
				'label'			=> esc_attr__( 'Carousel: Dots', 'xhyre' ),
				'description'	=> esc_attr__( 'Show dots navigation.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '0',
				'options'		=> [
					'1'				=> esc_attr__( 'Yes', 'xhyre' ),
					'0'				=> esc_attr__( 'No', 'xhyre' ),
				],
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Carousel : Speed
		$this->add_control(
			'carousel-speed',
			[
				'label'			=> esc_attr__( 'Carousel:Speed', 'xhyre' ),
				'description'	=> esc_attr__( 'Slider animation time (in ms.)', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> '3000',
				'condition'		=> [
					'view-type'		=> 'carousel',
				],
			]
		);
		// Columns
		$this->add_control(
			'view-column-section-heading',
			[
				'label'			=> esc_attr__( 'Column Settings', 'xhyre' ),
				'type'			=> Controls_Manager::HEADING,
				'separator'		=> 'before',
				'condition'		=> [
				]
			]
		);
		$this->add_control(
			'columns',
			[
				'label'			=> esc_attr__( 'View in Column', 'xhyre' ),
				'description'	=> esc_attr__( 'Select how many column to show.', 'xhyre' ),
				'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 and Subheading
		$this->start_controls_section(
			'heading_section',
			[
				'label' => esc_attr__( 'Heading and Subheading', 'xhyre' ),
			]
		);
		$this->add_control(
			'title',
			[
				'label'		=> esc_attr__( 'Heading', 'xhyre' ),
				'type'		=> Controls_Manager::TEXTAREA,
				'dynamic'	=> [
					'active'	=> true,
				],
				'default'		=> esc_attr__( 'Welcome to our site', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Enter your heading', 'xhyre' ),
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'title_link',
			[
				'label'			=> esc_attr__( 'Heading Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'subtitle',
			[
				'label'			=> esc_attr__( 'Subheading', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'placeholder'	=> esc_attr__( 'Enter your subtitle', 'xhyre' ),
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'subtitle_link',
			[
				'label'			=> esc_attr__( 'Subheading Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'desc',
			[
				'label'			=> esc_attr__( 'Description', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'placeholder'	=> esc_attr__( 'Type your description here', 'xhyre' ),
			]
		);
		$this->add_control(
			'reverse_title',
			[
				'label'			=> esc_attr__( 'Reverse Heading', 'xhyre' ),
				'description'	=> esc_attr__( 'Show Subheading before Heading', 'xhyre' ),
				'type'			=> Controls_Manager::SWITCHER,
				'label_on'		=> esc_attr__( 'Yes', 'xhyre' ),
				'label_off'		=> esc_attr__( 'No', 'xhyre' ),
				'return_value'	=> 'yes',
				'default'		=> '',
			]
		);
		$this->add_responsive_control(
			'text_align',
			[
				'label'			=> esc_attr__( 'Alignment', 'xhyre' ),
				'type'			=> Controls_Manager::CHOOSE,
				'options'		=> [
					'left'			=> [
						'title'			=> esc_attr__( 'Left', 'xhyre' ),
						'icon'			=> 'fa fa-align-left',
					],
					'center'		=> [
						'title'			=> esc_attr__( 'Center', 'xhyre' ),
						'icon'			=> 'fa fa-align-center',
					],
					'right'			=> [
						'title'			=> esc_attr__( 'Right', 'xhyre' ),
						'icon'			=> 'fa fa-align-right',
					],
				],
				'prefix_class'	=> 'pbmit-ele-header-align-',
				'selectors'		=> [
					'{{WRAPPER}} .pbmit-heading-subheading' => 'text-align: {{VALUE}};',
				],
			]
		);
		$this->end_controls_section();
		//Content
		$this->start_controls_section(
			'data_section',
			[
				'label' => esc_attr__( 'Content Options', 'xhyre' ),
			]
		);
		$this->add_control(
			'offset',
			[
				'label'			=> esc_attr__( 'Skip Post (offset)', 'xhyre' ),
				'description'	=> esc_attr__( 'How many Post you like to skip.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'label_block'	=> true,
				'default'		=> '',
				'options'		=> [
					''				=> esc_attr__( 'Show All Post (No skip)', 'xhyre' ),
					'1'				=> esc_attr__( 'Skip first Post', 'xhyre' ),
					'2'				=> esc_attr__( 'Skip two Posts', 'xhyre' ),
					'3'				=> esc_attr__( 'Skip three Posts', 'xhyre' ),
					'4'				=> esc_attr__( 'Skip four Posts', 'xhyre' ),
					'5'				=> esc_attr__( 'Skip five Posts', 'xhyre' ),
				]
			]
		);
		$this->add_control(
			'show',
			[
				'label'			=> esc_attr__( 'Post to show', 'xhyre' ),
				'description'	=> esc_attr__( 'How many Post you want to show.', 'xhyre' ),
				'separator'		=> 'before',
				'type'			=> Controls_Manager::NUMBER,
				'default'		=> '3',
			]
		);
		$this->add_control(
			'order',
			[
				'label'			=> esc_attr__( 'Order', 'xhyre' ),
				'description'	=> esc_attr__( 'Designates the ascending or descending order.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'separator'		=> 'before',
				'default'		=> 'DESC',
				'options'		=> [
					'ASC'			=> esc_attr__( 'Ascending order (1, 2, 3; a, b, c)', 'xhyre' ),
					'DESC'			=> esc_attr__( 'Descending order (3, 2, 1; c, b, a)', 'xhyre' ),
				]
			]
		);
		$this->add_control(
			'orderby',
			[
				'label'			=> esc_attr__( 'Order By', 'xhyre' ),
				'description'	=> esc_attr__( ' Sort retrieved posts by parameter.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> 'none',
				'options'		=> [
					'none'			=> esc_attr__( 'No order', 'xhyre' ),
					'ID'			=> esc_attr__( 'ID', 'xhyre' ),
					'title'			=> esc_attr__( 'Title', 'xhyre' ),
					'date'			=> esc_attr__( 'Date', 'xhyre' ),
					'rand'			=> esc_attr__( 'Random', 'xhyre' ),
				]
			]
		);
		$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', 'xhyre' ),
				'tab'	=> Controls_Manager::TAB_ADVANCED,
			]
		);
		$this->add_control(
			'tag_options',
			[
				'label'		=> esc_attr__( 'Tags for SEO', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'title_tag',
			[
				'label'		=> esc_attr__( 'Heading Tag', 'xhyre' ),
				'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', 'xhyre' ),
				'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'		=> esc_attr__( 'Gap between Logo boxes', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'gap',
			[
				'label'			=> esc_attr__( 'Box Gap', 'xhyre' ),
				'description'	=> esc_attr__( 'Gap between each job box.', 'xhyre' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> 'default',
				'options'		=> [
					'default'		=> esc_attr__( 'Default Gap', 'xhyre' ),
					'0px'			=> esc_attr__( 'No Gap (0px)', 'xhyre' ),
					'5px'			=> esc_attr__( '5px', 'xhyre' ),
					'10px'			=> esc_attr__( '10px', 'xhyre' ),
					'15px'			=> esc_attr__( '15px', 'xhyre' ),
					'20px'			=> esc_attr__( '20px', 'xhyre' ),
					'25px'			=> esc_attr__( '25px', 'xhyre' ),
					'30px'			=> esc_attr__( '30px', 'xhyre' ),
					'35px'			=> esc_attr__( '35px', 'xhyre' ),
					'40px'			=> esc_attr__( '40px', 'xhyre' ),
					'45px'			=> esc_attr__( '45px', 'xhyre' ),
					'50px'			=> esc_attr__( '50px', 'xhyre' ),
				],
			]
		);
		$this->end_controls_section();
	}
	protected function render() {
		if( !defined('JOB_MANAGER_PLUGIN_DIR') ){
			echo '<!-- The WP Job Manager plugin is not active -->';
			return;
		}
		$settings	= $this->get_settings_for_display();
		extract($settings);
		// check variables
		$columns = ( !empty($columns) ) ? $columns : '1' ;
		// swiper variables
		$swiper_class = '';
		if( isset($data['settings']["view-type"]) && !empty($data['settings']["view-type"]) && $data['settings']["view-type"]=='carousel' ){
			$swiper_class = ' swiper-wrapper';
		}
		?>
		<?php
		// Starting container
		$start_div = pbmit_element_container( array(
			'position'	=> 'start',
			'cpt'		=> 'jobs',
			'data'		=> $settings
		) );
		echo pbmit_esc_kses($start_div);
		?>
		<div class="pbmit-ele-header-area">
			<?php pbmit_heading_subheading($settings, true); ?>
		</div>
		<?php
		// Preparing $args
		$args = array(
			'post_type'				=> 'job_listing',
			'posts_per_page'		=> $show,
			'ignore_sticky_posts'	=> true,
		);
		if( !empty($offset) ){
			$args['offset'] = $offset;
		}
		if( !empty($orderby) && $orderby!='none' ){
			$args['orderby'] = $orderby;
			if( !empty($order) ){
				$args['order'] = $order;
			}
		}
		$posts = new \WP_Query( $args );
		if ( $posts->have_posts() ) {
			?>
			<div class="pbmit-element-posts-wrapper row multi-columns-row <?php if( !empty($settings['view-type']) && trim($settings['view-type'])=='carousel' ){ ?>swiper-container<?php } ?>" >
				<?php
				$odd_even = 'odd';
				$i = 1;
				while ( $posts->have_posts() ) {		
					$class = $i%2 ? 'pbmit-odd':'pbmit-even';		
					
					$posts->the_post();
					// Template
					if( file_exists( locate_template( '/theme-parts/jobs/jobs-style-'.esc_attr($style).'.php', false, false ) ) ){
						pbmit_element_block_container( array(
							'position'	=> 'start',
							'column'	=> $columns,
							'cpt'		=> 'jobs',
							'taxonomy'	=> 'pbmit-jobs-category',
							'style'		=> $style,
						),true );

						include( locate_template( '/theme-parts/jobs/jobs-style-'.esc_attr($style).'.php', false, false ) );
						
						pbmit_element_block_container( array(
							'position'	=> 'end',
						),true );
						}
					// odd or even
					if( $odd_even == 'odd' ){ $odd_even = 'even'; } else { $odd_even = 'odd'; }
					$i++;
				} ?>	
			</div>
			<?php wp_reset_postdata(); ?>
			<?php
			// Ending wrapper of the whole arear
			$end_div = pbmit_element_container( array(
				'position'	=> 'end',
				'cpt'		=> 'jobs',
				'data'		=> $settings
			) );
			echo pbmit_esc_kses($end_div);
			?>
			<?php
		}
	}
	protected function content_template() {}
}
// After the Schedule class is defined, I must register the new widget class with Elementor:
Plugin::instance()->widgets_manager->register( new pbmit_JobsElement() );
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨