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

📄 icon-heading.php

📁 Path: /home/s/t/a/stakrfrcol/agency/wp-content/themes/xhyre/includes/elementor/icon-heading.php
📊 Size: 14.38 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: Section Heading 
 */
class PBMIT_IconHeading 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_icon_heading';
	}
	// 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 Icon Heading 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-star';
	}
	// 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);
	}
	protected function register_controls() {
		// Style
		$this->start_controls_section(
			'select_style_section',
			[
				'label' => esc_attr__( 'Select Style', 'xhyre' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			]
		);
		$this->add_control(
			'style',
			[
				'label'			=> esc_attr__( 'Select Icon Heading View Style', 'xhyre' ),
				'description'	=> esc_attr__( 'Select Icon Heading View style.', 'xhyre' ),
				'type'			=> 'pbmit_imgselect',
				'label_block'	=> true,
				'thumb_width'	=> '110px',
				'default'		=> '1',
				'prefix'		=> 'pbmit-ihbox pbmit-ihbox-style-',
				'options'		=> pbmit_element_template_list( 'icon-heading', true ),
			]
		);
		$this->end_controls_section();
		//Content Service box
		$this->start_controls_section(
			'content_section',
			[
				'label' => esc_attr__( 'Icon and Heading', 'xhyre' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			]
		);
		$this->add_control(
			'icon_type',
			[
				'label'		=> esc_attr__( 'Icon Type', 'xhyre' ),
				'type'		=> Controls_Manager::SELECT,
				'options'	=> [
					'icon'		=> esc_attr__( 'Icon', 'xhyre' ),
					'image'		=> esc_attr__( 'Image', 'xhyre' ),
					'text'		=> esc_attr__( 'Text', 'xhyre' ),
					'none'		=> esc_attr__( 'None', 'xhyre' ),
				],
				'default'	=> esc_attr( 'icon' ),
				'condition'		=> [
					'style!'		=>  ['7','9','11','13'],
				]
			]
		);
		$this->add_control(
			'icon',
			[
				'label'		=> esc_attr__( 'Icon', 'xhyre' ),
				'type'		=> \Elementor\Controls_Manager::ICONS,
				'default'	=> [
					'value'		=> 'pbmit-xhyre-icon pbmit-xhyre-icon-staffing-1',
					'library'	=> 'pbmit-xhyre-icon',
				],
				'condition'	=> [
					'icon_type'	=> 'icon',
					'style!'	=>	['7','9','11','13'],
				]
			]
		);
		$this->add_control(
			'box_number',
			[
				'label'			=> esc_attr__( 'Box Number', 'xhyre' ),
				'description'	=> esc_attr__( '(Optional) Add box number like "01". This will be shown as steps.', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> '01',
				'placeholder'	=> esc_attr__( 'Enter number', 'xhyre' ),
				'label_block'	=> true,
				'condition'		=> [
					'icon_type'		=> ['icon','image'],
					'style'			=> ['3','6','7','12'],
				]
			]
		);
		$this->add_control(
			'icon_image',
			[
				'label'			=> esc_attr__( 'Select Image for Icon', 'xhyre' ),
				'description'	=> esc_attr__( 'This image will appear at icon position. Recommended size is 300x300 px transparent PNG file.', 'xhyre' ),
				'type'			=> \Elementor\Controls_Manager::MEDIA,
				'default'		=> [
					'url'			=> get_template_directory_uri() . '/images/icon-img.jpg',
				],
				'condition'		=> [
					'icon_type'		=> 'image',
					'style!'			=> ['7','9','11','13'],
				]
			]
		);
		$this->add_control(
			'icon_text',
			[
				'label'			=> esc_attr__( 'Text for Icon', 'xhyre' ),
				'description'	=> esc_attr__( 'The text will appear at icon position. This should be small text like "01" or "PX"', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( '01.', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Enter text here', 'xhyre' ),
				'label_block'	=> true,
				'condition'		=> [
					'icon_type'		=> 'text',
					'style!'		=> ['7','9','11','13'],
				]
			]
		);
		$this->add_control(
			'title',
			[
				'label'			=> esc_attr__( 'Heading', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Corporate Programs', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Enter your heading', 'xhyre' ),
				'label_block'	=> true,
				'condition'	  =>[
					'style!' 	=> ['6'],
				],
			]
		);
		$this->add_control(
			'title_link',
			[
				'label'			=> esc_attr__( 'Heading Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
				'condition'	  =>[
					'style!' 	=> ['4','6','7','10','11','12','13','14'],
				],
			]
		);
		$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,
				'condition'		=> [
					'style'			=> ['2','9','10','11','12','14'],
				]
			]
		);
		$this->add_control(
			'subtitle_link',
			[
				'label'			=> esc_attr__( 'Subheading Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
				'condition'		=> [
					'style'			=> [],
				]
			]
		);
		$this->add_control(
			'desc',
			[
				'label'			=> esc_attr__( 'Description', 'xhyre' ),
				'type'			=> Controls_Manager::TEXTAREA,
				'dynamic'		=> [
					'active'		=> true,
				],
				'placeholder'	=> esc_attr__( 'Type your description here', 'xhyre' ),
				'default'		=> esc_attr__( 'Insights by consulting an expert Knowledge Advisor through call, email or chat.', 'xhyre' ),
				'condition'		=>	[
					'style!'		=>	['2','4','8','9','10','11'],
				],
			]
		);
		// Button
		$this->add_control(
			'button_options',
			[
				'label'			=> esc_attr__( 'Button Options', 'xhyre' ),
				'type'			=> Controls_Manager::HEADING,
				'separator'		=> 'before',
				'condition'		=> [
					'style'			=> ['14'],
				],
			]
		);
		$this->add_control(
			'btn_title',
			[
				'label'			=> esc_attr__( 'Button Title', 'xhyre' ),
				'type'			=> Controls_Manager::TEXT,
				'dynamic'		=> [
					'active'		=> true,
				],
				'default'		=> esc_attr__( 'Read More', 'xhyre' ),
				'placeholder'	=> esc_attr__( 'Enter button title here', 'xhyre' ),
				'label_block'	=> true,
				'condition'		=> [
					'style'			=> ['14'],
				],
			]
		);
		$this->add_control(
			'btn_link',
			[
				'label'			=> esc_attr__( 'Button Link', 'xhyre' ),
				'type'			=> Controls_Manager::URL,
				'label_block'	=> true,
				'condition'		=> [
					'style'			=> ['14'],
				],
				'default'		=> array (
					'url'				=> '#',
					'is_external'		=> '',
					'nofollow'			=> '',
					'custom_attributes'	=> '',
				),
			]
		);
		$this->end_controls_section();
		//Style
		$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 Settings', 'xhyre' ),
				'tab'	=> Controls_Manager::TAB_ADVANCED,
			]
		);
		// HTML Tags
		$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->end_controls_section();
		// Typo
		$this->start_controls_section(
			'style_section',
			[
				'label'	=> pbmit_esc_kses('<img class="pbmit-tab-small-logo" src="'.get_template_directory_uri() . '/includes/images/pbm-small-logo.png" /> ') . esc_attr__( 'Typo Settings', 'xhyre' ),
				'tab'	=> Controls_Manager::TAB_ADVANCED,
			]
		);
		//Heading
		$this->add_control(
			'heading_title',
			[
				'label'		=> esc_attr__( 'Heading', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'title_color',
			[
				'label'		=> esc_attr__( 'Color', 'xhyre' ),
				'type'		=> Controls_Manager::COLOR,
				'default'	=> '',
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-element-heading'		=> 'color: {{VALUE}};',
					'{{WRAPPER}} .pbmit-element-heading > a'	=> 'color: {{VALUE}};',
				]
			]
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name'		=> 'title_typography',
				'selector'	=> '{{WRAPPER}} .pbmit-element-heading',
			]
		);
		$this->add_responsive_control(
			'title_bottom_space',
			[
				'label'		=> esc_attr__( 'Spacing', 'xhyre' ),
				'type'		=> Controls_Manager::SLIDER,
				'range'		=> [
					'px'		=> [
						'min'		=> 0,
						'max'		=> 100,
					],
				],
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-element-heading'	=> 'margin-bottom: {{SIZE}}{{UNIT}};',
				],
			]
		);
		//Subheading
		$this->add_control(
			'heading_stitle',
			[
				'label'		=> esc_attr__( 'Subheading', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'stitle_color',
			[
				'label'		=> esc_attr__( 'Color', 'xhyre' ),
				'type'		=> Controls_Manager::COLOR,
				'default'	=> '',
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-element-subheading'		=> 'color: {{VALUE}};',
					'{{WRAPPER}} .pbmit-element-subheading > a'	=> 'color: {{VALUE}};',
				]
			]
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name'		=> 'stitle_typography',
				'selector'	=> '{{WRAPPER}} .pbmit-element-subheading',
			]
		);
		$this->add_responsive_control(
			'stitle_bottom_space',
			[
				'label'		=> esc_attr__( 'Spacing', 'xhyre' ),
				'type'		=> Controls_Manager::SLIDER,
				'range'		=> [
					'px'		=> [
						'min'		=> 0,
						'max'		=> 100,
					],
				],
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-element-subheading'	=> 'margin-bottom: {{SIZE}}{{UNIT}};',
				],
			]
		);
		// Description
		$this->add_control(
			'heading_desc',
			[
				'label'		=> esc_attr__( 'Description', 'xhyre' ),
				'type'		=> Controls_Manager::HEADING,
				'separator'	=> 'before',
			]
		);
		$this->add_control(
			'desc_color',
			[
				'label'		=> esc_attr__( 'Color', 'xhyre' ),
				'type'		=> Controls_Manager::COLOR,
				'default'	=> '',
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-heading-desc'	=> 'color: {{VALUE}};',
				]
			]
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name'		=> 'desc_typography',
				'selector'	=> '{{WRAPPER}} .pbmit-heading-desc',
			]
		);
		$this->add_responsive_control(
			'desc_bottom_space',
			[
				'label'		=> esc_attr__( 'Spacing', 'xhyre' ),
				'type'		=> Controls_Manager::SLIDER,
				'range'		=> [
					'px'		=> [
						'min'		=> 0,
						'max'		=> 100,
					],
				],
				'selectors'	=> [
					'{{WRAPPER}} .pbmit-heading-desc'	=> 'margin-bottom: {{SIZE}}{{UNIT}};',
				],
			]
		);
		$this->end_controls_section();
	}
	protected function render() {
		$settings = $this->get_settings_for_display();
		extract($settings);
		$icon_html  = $title_html = $subtitle_html = $desc_html =  $nav_html = $button_html = $box_number_html = $btn_link = $icon_link = '';
		if( !empty($box_number) ){
			$box_number_html = '<div class="pbmit-ihbox-box-number">'.esc_attr($box_number).'</div>';
		}
		if( file_exists( locate_template( '/theme-parts/icon-heading/icon-heading-style-'.esc_attr($style).'.php', false, false ) ) ){
			// Heading
			if( !empty($settings['title']) ) {
				$title_tag	= ( !empty($settings['title_tag']) ) ? $settings['title_tag'] : 'h2' ;
				$title_html	= '<'. pbmit_esc_kses($title_tag) . ' class="pbmit-element-title">'.pbmit_link_render($settings['title_link'], 'start' ).''.pbmit_esc_kses($settings['title']).''.pbmit_link_render($settings['title_link'], 'end' ).'</'. pbmit_esc_kses($title_tag) . '>';
			}
			// Subheading
			if( !empty($settings['subtitle']) ) {
				$subtitle_tag	= ( !empty($settings['subtitle_tag']) ) ? $settings['subtitle_tag'] : 'h4' ;
				$subtitle_html	= '<'. pbmit_esc_kses($subtitle_tag) . ' class="pbmit-element-subtitle">
					'.pbmit_link_render($settings['subtitle_link'], 'start' ).'
						'.pbmit_esc_kses($settings['subtitle']).'
					'.pbmit_link_render($settings['subtitle_link'], 'end' ).'
					</'. pbmit_esc_kses($subtitle_tag) . '>
				';
			}
			// Description text
			if( !empty($settings['desc']) ){
				$desc_html = '<div class="pbmit-heading-desc">'.pbmit_esc_kses($settings['desc']).'</div>';
			}
			if( !empty($settings['btn_link']['url']) ){
				$btn_link = $settings['btn_link']['url'];
			}
			// Button
			if( !empty($settings['btn_title']) && !empty($settings['btn_link']['url']) ){
				$button_html = '<div class="pbmit-ihbox-btn">' . pbmit_link_render($settings['btn_link'], 'start' ) . pbmit_esc_kses($settings['btn_title']) . pbmit_link_render($settings['btn_link'], 'end' ) . '</div>';
			}
			if( !empty($settings['icon_link']['url']) ){
				$icon_link = $settings['icon_link']['url'];
			}
			?>
			<div class="pbmit-ihbox pbmit-ihbox-style-<?php echo esc_attr($style); ?>">
				<?php include( locate_template( '/theme-parts/icon-heading/icon-heading-style-'.esc_attr($style).'.php', false, false ) ); ?>
			</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_IconHeading() );
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨