🚀 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
$

📄 card-box.php

📁 Path: ./wp-content/themes/xhyre/includes/elementor/card-box.php
📊 Size: 17.86 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_CardBoxElement 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_card_box_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 Card Box 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-boxes';
	}
	// 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( isset($data['settings']["view-type"]) && !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 card box view Style', 'xhyre' ),
				'description'	=> esc_attr__( 'Select card box view style.', 'xhyre' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '1',
				'options'		=> pbmit_element_template_list( 'card-box', true ),
			]
		);
		$repeater = new Repeater();
		$repeater->add_control(
			'image',
			[
				'label'			=> esc_attr__( 'Choose Image', 'xhyre' ),
				'description'	=> esc_attr__( 'This image will appear as box Image. Recommended size is 1200x1000 px JPG or Transparent PNG file.', 'xhyre' ),
				'type'			=> Controls_Manager::MEDIA,
				'dynamic'		=> [
					'active' 		=> true,
				],
				'default' 		=> [
					'url' 			=> get_template_directory_uri() . '/images/card-box.jpg',
				],
			]
		);
		$repeater->add_control(
			'number',
			[
				'label'			=> esc_attr__( 'Number Text', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> esc_attr__( 'Number Text', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Number Text', 'xhyre' ),
			]
		);
		$repeater->add_control(
			'title',
			[
				'label'			=> esc_attr__( 'Title Text', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'default'		=> esc_attr__( 'Title Text', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Title Text', 'xhyre' ),
				'dynamic'		=> [
					'active'		=> true,
				],
			]
		);
		$repeater->add_control(
			'subtitle',
			[
				'label'			=> esc_attr__( 'Subtitle Text', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'default'		=> esc_attr__( 'Subtitle Text', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Subtitle Text', 'xhyre' ),
				'dynamic'		=> [
					'active'		=> true,
				],
			]
		);
		$repeater->add_control(
			'smalltext',
			[
				'label'			=> esc_attr__( 'Description', 'xhyre' ),
				'default'		=> esc_attr__( 'Description', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Description', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
			]
		);
		$repeater->add_control(
			'line1',
			[
				'label'			=> esc_attr__( 'Line1', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> esc_attr__( 'Line Text 1', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Line Text 1', 'xhyre' ),
				'label_block'	=> false,
			]
		);
		$repeater->add_control(
			'line2',
			[
				'label'			=> esc_attr__( 'Line2', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'default'		=> esc_attr__( 'Line Text 2', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Line Text 2', 'xhyre' ),
				'label_block'	=> false,
			]
		);
		$repeater->add_control(
			'btn_title',
			[
				'label'			=> esc_attr__( 'Button Title', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Read More', 'xhyre' ),
				'separator'		=> 'before',
				'placeholder'	=> esc_attr__( 'Enter button title here', 'xhyre' ),
				'label_block'	=> true,
			]
		);
		$repeater->add_control(
			'btn_link',
			[
				'label'			=> esc_attr__( 'Button Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$repeater->add_control(
			'text_btn_title',
			[
				'label'			=> esc_attr__( 'Text Btn Title', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Discover More', 'xhyre' ),
				'separator'		=> 'before',
				'placeholder'	=> esc_attr__( 'Enter button title here', 'xhyre' ),
				'label_block'	=> true,
			]
		);
		$repeater->add_control(
			'text_btn_link',
			[
				'label'			=> esc_attr__( 'Text Button Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
			]
		);
		$this->add_control(
			'boxes',
			[
				'label'		=> esc_attr__( 'Each card box Box Content', 'xhyre' ),
				'type'		=> Controls_Manager::REPEATER,
				'fields'	=> $repeater->get_controls(),
				'default'	=> [
					[
						'image'		=> get_template_directory_uri() . '/images/card-box.png',
						'number'	=> esc_attr__( '01', 'xhyre' ),
						'subtitle'	=> esc_attr__( 'Management', 'xhyre' ),
						'title'		=> esc_attr__( 'HR management Simplified', 'xhyre' ),
						'smalltext'	=> esc_attr__( 'Determine a defined future of work for your organization with a strong, flexible, global HR solution, which can help with time management, accuracy, compliance and employee engagement.', 'xhyre' ),
						'line1'		=> esc_attr( 'Automated HR workflows, forms and Insightful analytics', 'xhyre' ),
						'line2'		=> esc_attr( 'Monitor all firm resources provided to employees', 'xhyre' ),
						'btn_title'	=> esc_attr__('Read More', 'xhyre'),
						'btn_link'	=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
						'text_btn_title'	=> esc_attr__('Discover More', 'xhyre'),
						'text_btn_link'		=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
					],
					[
						'image'		=> get_template_directory_uri() . '/images/card-box.png',
						'number'	=> esc_attr__( '02', 'xhyre' ),
						'subtitle'	=> esc_attr__( 'Payroll Policies', 'xhyre' ),
						'title'		=> esc_attr__( 'Payroll for your global team in minutes', 'xhyre' ),
						'smalltext'	=> esc_attr__( 'Potential financial and legal repercussions from non-compliance and guarantee that employees are paid accurately and on time with precise payroll administration.', 'xhyre' ),
						'line1'		=> esc_attr( 'Using payroll management to plan future costs', 'xhyre' ),
						'line2'		=> esc_attr( 'Quickly determine payroll calculations and deductions', 'xhyre' ),
						'btn_title'	=> esc_attr__('Read More', 'xhyre'),
						'btn_link'	=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
						'text_btn_title'	=> esc_attr__('Discover More', 'xhyre'),
						'text_btn_link'		=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
					],
					[
						'image'		=> get_template_directory_uri() . '/images/card-box.png',
						'number'	=> esc_attr__( '03', 'xhyre' ),
						'subtitle'	=> esc_attr__( 'Employee', 'xhyre' ),
						'title'		=> esc_attr__( 'We are Committed when you Trust Us!', 'xhyre' ),
						'smalltext'	=> esc_attr__( 'We carefully screen all of our cleaners, so you can rest assured that your home would receive the absolute highest quality of service providing.', 'xhyre' ),
						'line1'		=> esc_attr( 'Monitor all firm resources provided to employees', 'xhyre' ),
						'line2'		=> esc_attr( 'Receive daily precise attendance status, with Notifications', 'xhyre' ),
						'btn_title'	=> esc_attr__('Read More', 'xhyre'),
						'btn_link'	=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
						'text_btn_title'	=> esc_attr__('Discover More', 'xhyre'),
						'text_btn_link'		=> array(
							'url'				=> '',
							'is_external'		=> '',
							'nofollow'			=> '',
							'custom_attributes'	=> '',
						),
					],
				],
				'title_field' => '{{{ title }}}',
			]
		);
		$this->end_controls_section();
		// Heading and Subheading
		$this->start_controls_section(
			'heading_section',
			[
				'label'	=> esc_attr__( 'Heading and Subheading', 'xhyre' ),
			]
		);
		$this->add_control(
			'title_animation',
			[
				'label'			=> esc_attr__( 'Heading Animation', 'xhyre' ),
				'description'	=> esc_attr__( 'Select Heading Text Animation View style.', 'xhyre' ) . ' ' . pbmit_esc_kses('<br><a target="_blank" href="' . esc_url('http://xhyre-demo.pbminfotech.com/demo1/element/#heading-animations') . '">' . esc_attr__( 'See all anmiation demo here.', 'xhyre' ) . '</a>' ),
				'type'			=> Controls_Manager::SELECT,
				'default'		=> '4',
				'options'		=> [
					'4'				=> esc_attr__( 'No animation', 'xhyre' ),
					'1'				=> esc_attr__( 'Animation Style 1', 'xhyre' ),
					'2'				=> esc_attr__( 'Animation Style 2', 'xhyre' ),
					'3'				=> esc_attr__( 'Animation Style 3', 'xhyre' ),
				],
				'separator'		=> 'before',
			]
		);
		$this->add_control(
			'title',
			[
				'label'			=> esc_attr__( 'Heading', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default' 	 	=> esc_attr__( 'Card Box', '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 subheading', '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 Title', 'xhyre' ),
				'description'	=> esc_attr__( 'Show sub-title before title', '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}};',
				],
				'dynamic' 		=> [
					'active' 		=> true,
				],
				'default' 		=> 'left',
			]
		);
		$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__( 'Title 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__( 'SubTitle 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->end_controls_section();
	}
	protected function render() {
		$settings	= $this->get_settings_for_display();
		extract($settings);
		?>
		<?php
		// Starting container
		pbmit_element_container( array(
			'position'	=> 'start',
			'cpt'		=> 'card-box',
			'data'		=> $settings
		) );
		?> 
		<div class="pbmit-ele-header-area"> 
			<?php pbmit_heading_subheading($settings, true); ?>
		</div>
			<div class="pbmit-element-card-box-wrapper">
				<?php
				$return ='';
				if( $settings['style'] == '1') { ?>
					<div class="pbmit-content-box">
						<?php
						foreach( $settings['boxes'] as $box ){
							$small_text = $title_html = $subtitle_html = $image_html = $line3 = $button_html = $text_button_html = '';
							$title_html = '<div class="pbmit-card-box-title"><h2>'.pbmit_esc_kses($box['title']).'</h2></div>';
							$subtitle_html = '<div class="pbmit-card-box-subtitle"><h4>'.pbmit_esc_kses($box['subtitle']).'</h4></div>';
							$small_text .= ( !empty($box['smalltext']) ) ? '<div class="pbmit-card-box-desc">'.pbmit_esc_kses($box['smalltext']).'</div>' : '' ;
							$number = '<div class="pbmit-card-box-number"><h4>'.pbmit_esc_kses($box['number']).'</h4></div>';
							$line3 .= ( !empty($box['line1']) ) ? '<div class="pbmit-card-box-line-inner"><p>'.esc_html($box['line1']).'</p></div>' : '' ;
							$line3 .= ( !empty($box['line2']) ) ? '<div class="pbmit-card-box-line-inner"><p>'.esc_html($box['line2']).'</p></div>' : '' ;
							if( !empty($box['image']) ){
								$image_html .= '<img src="'.$box['image']['url'].'" alt="'.esc_attr($box['title']).'" />';
							}
							if( !empty($image_html) ){
								$image_html = '<div class="pbmit-card-box-item-image">'.$image_html.'</div>';
							}
							// Button
							$button_link = $box['btn_link']['url'];
							if( !empty($box['btn_title']) && !empty($box['btn_link']['url']) ){
								$button_html = '<div class="pbmit-card-btn">' . pbmit_link_render($box['btn_link'], 'start' ) . pbmit_esc_kses($box['btn_title']) . pbmit_link_render($box['btn_link'], 'end' ) . '</div>';
							}
							// Text Button
							$text_button_link = $box['text_btn_link']['url'];
							if( !empty($box['text_btn_title']) && !empty($box['text_btn_link']['url']) ){
								$text_button_html = '<div class="pbmit-card-text-btn">' . pbmit_link_render($box['text_btn_link'], 'start' ) . pbmit_esc_kses($box['text_btn_title']) . pbmit_link_render($box['text_btn_link'], 'end' ) . '</div>';
							}
							?>
							<div class= "pbmit-card-box-wrapper">
								<div class="pbmit-card-box-wrapper-inner row g-0 align-items-center justify-content-between">
									<div class="pbmit-card-box-img col-lg-6 col-md-12">
										<?php echo pbmit_esc_kses($image_html); ?>
									</div>
									<div class="pbmit-card-box col-lg-6 col-md-12">
										<div class="pbmit-card-box-wrap">
											<?php echo pbmit_esc_kses($number); ?>
											<?php echo pbmit_esc_kses($subtitle_html); ?>
										</div>
										<?php echo pbmit_esc_kses($title_html); ?>
										<?php echo pbmit_esc_kses($small_text);?>
										<div class="pbmit-card-box-line">
											<?php echo pbmit_esc_kses($line3);?>
										</div>
										<div class="pbmit-card-box-button">
											<?php echo pbmit_esc_kses( $button_html ); ?>
											<?php echo pbmit_esc_kses( $text_button_html ); ?>
										</div>
									</div>
								</div>
							</div>
						<?php } // foreach
						echo pbmit_esc_kses($return); ?>
					</div>
				<?php } else {
					foreach( $settings['boxes'] as $box ){
						//Template
						if( file_exists( locate_template( '/theme-parts/card-box/card-box-style-'.esc_attr($style).'.php', false, false ) ) ){
							$return .= pbmit_element_block_container( array(
								'position'	=> 'start',
								'column'	=> $columns,
								'cpt'		=> 'card-box',
								'style'		=> $style
							) );
							ob_start();
							include( locate_template( '/theme-parts/card-box/card-box-style-'.esc_attr($style).'.php', false, false ) );
							$return .= ob_get_contents();
							ob_end_clean();
							$return .= pbmit_element_block_container( array(
								'position'	=> 'end',
							) );
						}
					}
				}?>
			</div>
		<?php
		// Ending wrapper of the whole arear
		pbmit_element_container( array(
			'position'	=> 'end',
			'cpt'		=> 'card-box',
			'data'		=> $settings
		) );
		?>
		<?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_cardboxElement() );
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨