403Webshell
Server IP : 69.72.244.102  /  Your IP : 216.73.216.164
Web Server : LiteSpeed
System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
User : konzalta ( 1271)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/thread-self/cwd/wp-content/plugins/portx-core/include/elementor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/cwd/wp-content/plugins/portx-core/include/elementor/services.php
<?php
namespace TPCore\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use \Elementor\Group_Control_Background;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Repeater;
use \Elementor\Utils;
use TPCore\Elementor\Controls\Group_Control_TPBGGradient;
use TPCore\Elementor\Controls\Group_Control_TPGradient;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Tp Core
 *
 * Elementor widget for hello world.
 *
 * @since 1.0.0
 */
class TP_Services extends Widget_Base {

    use \TPCore\Widgets\TPCoreElementFunctions;

    /**
     * Retrieve the widget name.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget name.
     */
    public function get_name() {
        return 'services';
    }

    /**
     * Retrieve the widget title.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget title.
     */
    public function get_title() {
        return __( 'Services', 'tpcore' );
    }

    /**
     * Retrieve the widget icon.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget icon.
     */
    public function get_icon() {
        return 'tp-icon';
    }

    /**
     * Retrieve the list of categories the widget belongs to.
     *
     * Used to determine where to display the widget in the editor.
     *
     * Note that currently Elementor supports only one category.
     * When multiple categories passed, Elementor uses the first one.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return array Widget categories.
     */
    public function get_categories() {
        return [ 'tpcore' ];
    }

    /**
     * Retrieve the list of scripts the widget depended on.
     *
     * Used to set scripts dependencies required to run the widget.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return array Widget scripts dependencies.
     */
    public function get_script_depends() {
        return [ 'tpcore' ];
    }

    /**
     * Register the widget controls.
     *
     * Adds different input fields to allow the user to change and customize the widget settings.
     *
     * @since 1.0.0
     *
     * @access protected
     */

    protected function register_controls(){
        $this->register_controls_section();
        $this->style_tab_content();
    }   
    protected function register_controls_section() {

        // layout Panel
        $this->start_controls_section(
            'tp_layout',
            [
                'label' => esc_html__('Design Layout', 'tpcore'),
            ]
        );
        $this->add_control(
            'tp_design_style',
            [
                'label' => esc_html__('Select Layout', 'tpcore'),
                'type' => Controls_Manager::SELECT,
                'options' => [
                    'layout-1' => esc_html__('Layout 1', 'tpcore'),
                    'layout-2' => esc_html__('Layout 2', 'tpcore'),
                    'layout-3' => esc_html__('Layout 3', 'tpcore'),
                    'layout-4' => esc_html__('Layout 4', 'tpcore'),
                    'layout-5' => esc_html__('Layout 5', 'tpcore'),
                ],
                'default' => 'layout-1',
            ]
        );

        $this->end_controls_section();

        $this->tp_section_title_render_controls('services', 'Section Title', 'Sub Title', 'your title here', $default_description = 'Hic nesciunt galisum aut dolorem aperiam eum soluta quod ea cupiditate.');

        // Service group
        $this->start_controls_section(
            'tp_services',
            [
                'label' => esc_html__('Services List', 'tpcore'),
                'description' => esc_html__( 'Control all the style settings from Style tab', 'tpcore' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $repeater = new \Elementor\Repeater();

        $repeater->add_control(
            'repeater_condition',
            [
                'label' => __( 'Field condition', 'tpcore' ),
                'type' => Controls_Manager::SELECT,
                'options' => [
                    'style_1' => __( 'Style 1', 'tpcore' ),
                    'style_2' => __( 'Style 2', 'tpcore' ),
                    'style_3' => __( 'Style 3', 'tpcore' ),
                    'style_4' => __( 'Style 4', 'tpcore' ),
                    'style_5' => __( 'Style 5', 'tpcore' ),
                ],
                'default' => 'style_1',
                'frontend_available' => true,
                'style_transfer' => true,
            ]
        );

        $repeater->add_control(
            'tp_box_icon_type',
            [
                'label' => esc_html__('Select Icon Type', 'tpcore'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'icon',
                'options' => [
                    'image' => esc_html__('Image', 'tpcore'),
                    'icon' => esc_html__('Icon', 'tpcore'),
                    'svg' => esc_html__('SVG', 'tpcore'),
                ],
            ]
        );

        $repeater->add_control(
            'tp_box_icon_svg',
            [
                'show_label' => false,
                'type' => Controls_Manager::TEXTAREA,
                'label_block' => true,
                'placeholder' => esc_html__('SVG Code Here', 'tpcore'),
                'condition' => [
                    'tp_box_icon_type' => 'svg',
                ]
            ]
        );

        $repeater->add_control(
            'tp_box_icon_image',
            [
                'label' => esc_html__('Upload Icon Image', 'tpcore'),
                'type' => Controls_Manager::MEDIA,
                'default' => [
                    'url' => Utils::get_placeholder_image_src(),
                ],
                'condition' => [
                    'tp_box_icon_type' => 'image',
                ]
            ]
        );

        if (tp_is_elementor_version('<', '2.6.0')) {
            $repeater->add_control(
                'tp_box_icon',
                [
                    'show_label' => false,
                    'type' => Controls_Manager::ICON,
                    'label_block' => true,
                    'default' => 'fa fa-star',
                    'condition' => [
                        'tp_box_icon_type' => 'icon',
                    ]
                ]
            );
        } else {
            $repeater->add_control(
                'tp_box_selected_icon',
                [
                    'show_label' => false,
                    'type' => Controls_Manager::ICONS,
                    'fa4compatibility' => 'icon',
                    'label_block' => true,
                    'default' => [
                        'value' => 'fas fa-star',
                        'library' => 'solid',
                    ],
                    'condition' => [
                        'tp_box_icon_type' => 'icon',
                    ]
                ]
            );
        }

        $repeater->add_control(
            'tp_service_word', [
                'label' => esc_html__('Single Word', 'tpcore'),
                'description' => tp_get_allowed_html_desc( 'basic' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('01', 'tpcore'),
                'condition' => [
                    'repeater_condition' => 'style_1'
                ]
            ]
        );

        $repeater->add_control(
            'tp_service_title', [
                'label' => esc_html__('Title', 'tpcore'),
                'description' => tp_get_allowed_html_desc( 'basic' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Service Title', 'tpcore'),
                'label_block' => true,
            ]
        );

        $repeater->add_control(
            'tp_service_des', [
                'label' => esc_html__('Description', 'tpcore'),
                'description' => tp_get_allowed_html_desc( 'basic' ),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => esc_html__('With over 1 million+ homes for sale available on the website, Trulia can match you with a house you will want', 'tpcore'),
                'label_block' => true,
                'condition' => [
                    'repeater_condition' => ['style_1', 'style_3', 'style_4', 'style_5']
                ]
            ]
        );

        $repeater->add_control(
            'tp_service_bottom', [
                'label' => esc_html__('Service Bottom Title', 'tpcore'),
                'description' => tp_get_allowed_html_desc( 'basic' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Can We Assit You!', 'tpcore'),
                'label_block' => true,
                'condition' => [
                    'repeater_condition' => 'style_3'
                ]
            ]
        );

        $repeater->add_control(
            'tp_services_link_switcher',
            [
                'label' => esc_html__( 'Add Services link', 'tpcore' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__( 'Yes', 'tpcore' ),
                'label_off' => esc_html__( 'No', 'tpcore' ),
                'return_value' => 'yes',
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $repeater->add_control(
            'tp_services_btn_text',
            [
                'label' => esc_html__('Button Text', 'tpcore'),
                'type' => Controls_Manager::TEXT,
                'default' => esc_html__('Button Text', 'tpcore'),
                'title' => esc_html__('Enter button text', 'tpcore'),
                'label_block' => true,
                'condition' => [
                    'tp_services_link_switcher' => 'yes',
                    'repeater_condition' => ['style_3', 'style_5']
                ],
            ]
        );

        $repeater->add_control(
            'tp_services_link_type',
            [
                'label' => esc_html__( 'Service Link Type', 'tpcore' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    '1' => 'Custom Link',
                    '2' => 'Internal Page',
                ],
                'default' => '1',
                'condition' => [
                    'tp_services_link_switcher' => 'yes'
                ]
            ]
        );
        $repeater->add_control(
            'tp_services_link',
            [
                'label' => esc_html__( 'Service Link link', 'tpcore' ),
                'type' => \Elementor\Controls_Manager::URL,
                'dynamic' => [
                    'active' => true,
                ],
                'placeholder' => esc_html__( 'https://your-link.com', 'tpcore' ),
                'show_external' => true,
                'default' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
                'condition' => [
                    'tp_services_link_type' => '1',
                    'tp_services_link_switcher' => 'yes',
                ]
            ]
        );
        $repeater->add_control(
            'tp_services_page_link',
            [
                'label' => esc_html__( 'Select Service Link Page', 'tpcore' ),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'label_block' => true,
                'options' => tp_get_all_pages(),
                'condition' => [
                    'tp_services_link_type' => '2',
                    'tp_services_link_switcher' => 'yes',
                ]
            ]
        );
        
        // creative animation
        $repeater->add_control(
			'tp_creative_anima_switcher',
			[
				'label' => esc_html__( 'Active Animation', 'tpcore' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => esc_html__( 'Yes', 'tpcore   ' ),
				'label_off' => esc_html__( 'No', 'tpcore   ' ),
				'return_value' => 'yes',
				'default' => '0',
                'separator' => 'before',
			]
		);

        $repeater->add_control(
            'tp_anima_type',
            [
                'label' => __( 'Animation Type', 'tpcore' ),
                'type' => Controls_Manager::SELECT,
                'options' => [
                    'fadeInUp' => __( 'fadeInUp', 'tpcore' ),
                    'fadeInDown' => __( 'fadeInDown', 'tpcore' ),
                    'fadeInLeft' => __( 'fadeInLeft', 'tpcore' ),
                    'fadeInRight' => __( 'fadeInRight', 'tpcore' ),
                ],
                'default' => 'fadeInUp',
                'frontend_available' => true,
                'style_transfer' => true,
                'condition' => [
                    'tp_creative_anima_switcher' => 'yes',
                ],
            ]
        );
        
        $repeater->add_control(
            'tp_anima_dura', [
                'label' => esc_html__('Animation Duration', 'tpcore'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('0.3s', 'tpcore'),
                'condition' => [
                    'tp_creative_anima_switcher' => 'yes',
                ],
            ]
        );
        
        $repeater->add_control(
            'tp_anima_delay', [
                'label' => esc_html__('Animation Delay', 'tpcore'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('0.6s', 'tpcore'),
                'condition' => [
                    'tp_creative_anima_switcher' => 'yes',
                ],
            ]
        );

        $repeater->add_control(
            'tp_service_bg',
            [
                'label' => esc_html__('Upload Background Image', 'tpcore'),
                'type' => Controls_Manager::MEDIA,
                'default' => [
                    'url' => Utils::get_placeholder_image_src(),
                ],
                'condition' => [
                    'repeater_condition' => ['style_1', 'style_5']
                ]
            ]
        );

        $repeater->add_control(
            'tp_services_class',
            [
                'label' => esc_html__('Extra Class', 'tpcore'),
                'type' => Controls_Manager::TEXT,
                'title' => esc_html__('Enter class text', 'tpcore'),
                'condition' => [
                    'repeater_condition' => 'style_3'
                ],
            ]
        );

        $this->add_control(
            'tp_service_list',
            [
                'label' => esc_html__('Services - List', 'tpcore'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $repeater->get_controls(),
                'default' => [
                    [
                        'tp_service_title' => esc_html__('Business Stratagy', 'tpcore'),
                    ],
                    [
                        'tp_service_title' => esc_html__('Website Development', 'tpcore')
                    ],
                    [
                        'tp_service_title' => esc_html__('Marketing & Reporting', 'tpcore')
                    ]
                ],
                'title_field' => '{{{ tp_service_title }}}',
            ]
        );

        $this->add_group_control(
            Group_Control_Image_Size::get_type(),
            [
                'name' => 'thumbnail', // // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`.
                'exclude' => ['custom'],
                // 'default' => 'tp-post-thumb',
            ]
        );
        
        $this->end_controls_section();

        // shape
        $this->start_controls_section(
        'tp_shape',
            [
                'label' => esc_html__( 'Shape Section', 'tpcore' ),
                'condition' => [
                    'tp_design_style' => ['layout-1','layout-2','layout-3','layout-4',]
                ]
            ]
        );

        $this->add_control(
        'tp_shape_switch',
        [
            'label'        => esc_html__( 'Shape On/Off', 'tpcore' ),
            'type'         => \Elementor\Controls_Manager::SWITCHER,
            'label_on'     => esc_html__( 'Show', 'tpcore' ),
            'label_off'    => esc_html__( 'Hide', 'tpcore' ),
            'return_value' => 'yes',
            'default'      => '0',
        ]
        );

        $this->add_control(
            'tp_shape_image_1',
            [
                'label' => esc_html__( 'Choose Shape Image 1', 'tp-core' ),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
                'condition' => [
                    'tp_shape_switch' => 'yes'
                ]
            ]
        );

        $this->add_control(
            'tp_shape_image_2',
            [
                'label' => esc_html__( 'Choose Shape Image 2', 'tp-core' ),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
                'condition' => [
                    'tp_shape_switch' => 'yes',
                    'tp_design_style' => ['layout-1', 'layout-2', 'layout-3']
                ]
            ]
        );

        $this->add_control(
            'tp_shape_image_3',
            [
                'label' => esc_html__( 'Choose Shape Image 3', 'tp-core' ),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
                'condition' => [
                    'tp_shape_switch' => 'yes',
                    'tp_design_style' => 'layout-2'
                ]
            ]
        );

        $this->add_group_control(
            Group_Control_Image_Size::get_type(),
            [
                'name' => 'shape_image_size', // // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`.
                'exclude' => ['custom'],
                'condition' => [
                    'tp_shape_switch' => 'yes'
                ]
            ]
        );
        
        $this->end_controls_section();
        
        
    }

    // style_tab_content
    protected function style_tab_content(){
        $this->tp_section_style_controls('services_section', 'Section - Style', '.tp-el-section');
    }

    /**
     * Render the widget output on the frontend.
     *
     * Written in PHP and used to generate the final HTML.
     *
     * @since 1.0.0
     *
     * @access protected
     */
    protected function render() {
        $settings = $this->get_settings_for_display();

        ?>

<?php if ( $settings['tp_design_style']  == 'layout-2' ) : 
    // shape image
    if ( !empty($settings['tp_shape_image_1']['url']) ) {
        $tp_shape_image = !empty($settings['tp_shape_image_1']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_1']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_1']['url'];
        $tp_shape_image_alt = get_post_meta($settings["tp_shape_image_1"]["id"], "_wp_attachment_image_alt", true);
    }
    if ( !empty($settings['tp_shape_image_2']['url']) ) {
        $tp_shape_image_2 = !empty($settings['tp_shape_image_2']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_2']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_2']['url'];
        $tp_shape_image_alt_2 = get_post_meta($settings["tp_shape_image_2"]["id"], "_wp_attachment_image_alt", true);
    }
    if ( !empty($settings['tp_shape_image_3']['url']) ) {
        $tp_shape_image_3 = !empty($settings['tp_shape_image_3']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_3']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_3']['url'];
        $tp_shape_image_alt_3 = get_post_meta($settings["tp_shape_image_3"]["id"], "_wp_attachment_image_alt", true);
    }
    $this->add_render_attribute('title_args', 'class', 'tpfeatures-tpfeatures-title-2 mb-30');
    ?>

    <div class="tpfeatures__area pt-120 pb-80 grey-bg p-relative fix tp-el-section">

        <?php if(!empty($tp_shape_image)) : ?>
        <div class="tpfeatures__circual-img">
            <img src="<?php echo esc_url($tp_shape_image); ?>" alt="<?php echo esc_attr($tp_shape_image_alt); ?>">
        </div>
        <?php endif; ?>

        <?php if(!empty($tp_shape_image_2)) : ?>
        <div class="tpfeatures__left-img wow slideInLeft   ">
            <img src="<?php echo esc_url($tp_shape_image_2); ?>" alt="<?php echo esc_attr($tp_shape_image_alt_2); ?>">
        </div>
        <?php endif; ?>

        <?php if(!empty($tp_shape_image_3)) : ?>
        <div class="tpfeatures__shap">
            <img src="<?php echo esc_url($tp_shape_image_3); ?>" alt="<?php echo esc_attr($tp_shape_image_alt_3); ?>">
        </div>
        <?php endif; ?>

        <div class="container">
            <div class="row justify-content-center">
                <div class="col-xxl-6 col-xl-5 col-lg-10">
                    <div class="tpfeatures__content wow fadeInUp   text-center text-lg-start" data-wow-duration=".9s" data-wow-delay=".3s">
                        <?php if ( !empty($settings['tp_services_sub_title']) ) : ?>
                        <div class="tp-section__subtitle mb-15 p-relative"><?php echo tp_kses($settings['tp_services_sub_title']); ?></div>
                        <?php endif; ?>
                        <?php
                        if ( !empty($settings['tp_services_title' ]) ) :
                            printf( '<%1$s %2$s>%3$s</%1$s>',
                            tag_escape( $settings['tp_services_title_tag'] ),
                            $this->get_render_attribute_string( 'title_args' ),
                            tp_kses( $settings['tp_services_title' ] )
                            );
                        endif;
                        ?>
                        <?php if ( !empty($settings['tp_services_description']) ) : ?>
                        <p class="p-relative"><?php echo tp_kses( $settings['tp_services_description'] ); ?></p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="col-xxl-6 col-xl-7 col-lg-10">
                    <div class="tpfeatures-box">
                        <div class="row ">


                            <?php foreach ($settings['tp_service_list'] as $key => $item) :
                                // Link
                                if ('2' == $item['tp_services_link_type']) {
                                    $link = get_permalink($item['tp_services_page_link']);
                                    $target = '_self';
                                    $rel = 'nofollow';
                                } else {
                                    $link = !empty($item['tp_services_link']['url']) ? $item['tp_services_link']['url'] : '';
                                    $target = !empty($item['tp_services_link']['is_external']) ? '_blank' : '';
                                    $rel = !empty($item['tp_services_link']['nofollow']) ? 'nofollow' : '';
                                }
                            ?>
                            <?php if(!empty($item['tp_creative_anima_switcher'])) : ?>
                            <div class="col-xl-4  col-lg-4 col-md-4  mb-40 wow text-center <?php echo esc_attr($item['tp_anima_type']); ?> " data-wow-duration="<?php echo esc_attr($item['tp_anima_dura']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']); ?>">
                            <?php else : ?>
                            <div class="col-xl-4  col-lg-4 col-md-4 mb-40 text-center">
                            <?php endif; ?>
                                <div class="tpfeatures__single-box">

                                    <?php if($item['tp_box_icon_type'] == 'icon') : ?>
                                        <?php if (!empty($item['tp_box_icon']) || !empty($item['tp_box_selected_icon']['value'])) : ?>
                                        <span>
                                            <?php tp_render_icon($item, 'tp_box_icon', 'tp_box_selected_icon'); ?>
                                        </span>
                                        <?php endif; ?>
                                    <?php elseif( $item['tp_box_icon_type'] == 'image' ) : ?>
                                        <?php if (!empty($item['tp_box_icon_image']['url'])): ?>
                                        <span>
                                            <img src="<?php echo $item['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
                                        </span>
                                        <?php endif; ?>
                                    <?php else : ?>
                                        <?php if (!empty($item['tp_box_icon_svg'])): ?>
                                        <span>
                                            <?php echo $item['tp_box_icon_svg']; ?>
                                        </span>
                                        <?php endif; ?>
                                    <?php endif; ?>

                                    <?php if (!empty($item['tp_service_title' ])): ?>
                                    <h3 class="tpfeatures-title-2">
                                        <?php if ($item['tp_services_link_switcher'] == 'yes') : ?>
                                        <a href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_service_title' ]); ?></a>
                                        <?php else : ?>
                                        <?php echo tp_kses($item['tp_service_title' ]); ?>
                                        <?php endif; ?>
                                    </h3>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <?php endforeach; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php elseif ( $settings['tp_design_style']  == 'layout-3' ) : 
    // shape image
    if ( !empty($settings['tp_shape_image_1']['url']) ) {
        $tp_shape_image = !empty($settings['tp_shape_image_1']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_1']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_1']['url'];
        $tp_shape_image_alt = get_post_meta($settings["tp_shape_image_1"]["id"], "_wp_attachment_image_alt", true);
    }
    if ( !empty($settings['tp_shape_image_2']['url']) ) {
        $tp_shape_image_2 = !empty($settings['tp_shape_image_2']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_2']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_2']['url'];
        $tp_shape_image_alt_2 = get_post_meta($settings["tp_shape_image_2"]["id"], "_wp_attachment_image_alt", true);
    }
    
    $this->add_render_attribute('title_args', 'class', 'tp-section__title wow fadeInUp');
    $this->add_render_attribute('title_args', 'data-wow-duration', '.9s');
    $this->add_render_attribute('title_args', 'data-wow-delay', '.5s');
?>

<section class="tp-services-2__area pt-120 pb-80 p-relative fix tp-el-section">

    <?php if(!empty($tp_shape_image)) : ?>
    <div class="tp-services-2__shap-3  wow slideInLeft ">
        <img src="<?php echo esc_url($tp_shape_image); ?>" alt="<?php echo esc_attr($tp_shape_image_alt); ?>">
    </div>
    <?php endif; ?>
    <?php if(!empty($tp_shape_image_2)) : ?>
    <div class="tp-services-2__shap-4  wow slideInRight d-none d-xl-block">
        <img src="<?php echo esc_url($tp_shape_image_2); ?>" alt="<?php echo esc_attr($tp_shape_image_alt_2); ?>">
    </div>
    <?php endif; ?>

    <div class="container">
        <div class="row">
            <div class="col-xl-6">
                <div class="tp-services-2__section-title z-index  pb-40">
                    
                    <?php if ( !empty($settings['tp_services_sub_title']) ) : ?>
                    <div class="tp-section__subtitle mb-15 p-relative wow fadeInUp  " data-wow-duration=".9s" data-wow-delay=".3s"><?php echo tp_kses($settings['tp_services_sub_title']); ?></div>
                    <?php endif; ?>
                    <?php
                    if ( !empty($settings['tp_services_title' ]) ) :
                        printf( '<%1$s %2$s>%3$s</%1$s>',
                        tag_escape( $settings['tp_services_title_tag'] ),
                        $this->get_render_attribute_string( 'title_args' ),
                        tp_kses( $settings['tp_services_title' ] )
                        );
                    endif;
                    ?>
                    <?php if ( !empty($settings['tp_services_description']) ) : ?>
                    <p><?php echo tp_kses( $settings['tp_services_description'] ); ?></p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div class="row">

            <?php foreach ($settings['tp_service_list'] as $key => $item) :
                // Link
                if ('2' == $item['tp_services_link_type']) {
                    $link = get_permalink($item['tp_services_page_link']);
                    $target = '_self';
                    $rel = 'nofollow';
                } else {
                    $link = !empty($item['tp_services_link']['url']) ? $item['tp_services_link']['url'] : '';
                    $target = !empty($item['tp_services_link']['is_external']) ? '_blank' : '';
                    $rel = !empty($item['tp_services_link']['nofollow']) ? 'nofollow' : '';
                }
                // bg image
                if ( !empty($item['tp_service_bg']['url']) ) {
                    $tp_service_bg = !empty($item['tp_service_bg']['id']) ? wp_get_attachment_image_url( $item['tp_service_bg']['id'], $settings['thumbnail_size']) : $item['tp_service_bg']['url'];
                    $tp_service_bg_alt = get_post_meta($item["tp_service_bg"]["id"], "_wp_attachment_image_alt", true);
                }
            ?>
            <?php if(!empty($item['tp_creative_anima_switcher'])) : ?>
            <div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 wow <?php echo esc_attr($item['tp_anima_type']); ?> " data-wow-duration="<?php echo esc_attr($item['tp_anima_dura']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']); ?>">
            <?php else : ?>
            <div class="col-xl-4 col-lg-4 col-md-4 col-sm-6">
            <?php endif; ?>
                <div class="tp-services-2__item mb-40 <?php echo esc_attr($item['tp_services_class']); ?>">
                    
                    <div class="tp-services-2__thumb mb-25 p-relative fix">

                        <?php echo $link ? "<a href=".esc_url($link).">": NULL ; ?>
                            <?php if($item['tp_box_icon_type'] == 'icon') : ?>
                                <?php if (!empty($item['tp_box_icon']) || !empty($item['tp_box_selected_icon']['value'])) : ?>
                                    <?php tp_render_icon($item, 'tp_box_icon', 'tp_box_selected_icon'); ?>
                                <?php endif; ?>
                            <?php elseif( $item['tp_box_icon_type'] == 'image' ) : ?>
                                <?php if (!empty($item['tp_box_icon_image']['url'])): ?>
                                    <img class="w-100" src="<?php echo $item['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
                                <?php endif; ?>
                            <?php else : ?>
                                <?php if (!empty($item['tp_box_icon_svg'])): ?>
                                    <?php echo $item['tp_box_icon_svg']; ?>
                                <?php endif; ?>
                            <?php endif; ?>
                        <?php echo $link ? "</a>": NULL ; ?>

                        <?php if(!empty($link)) : ?>
                        <div class="tp-services-2__icon">
                            <a href="<?php echo esc_url($link); ?>"><i class="fa-sharp fa-solid fa-plus"></i></a>
                        </div>
                        <?php endif; ?>
                    </div>

                    <div class="tp-services-2__content">

                        <?php if (!empty($item['tp_service_title' ])): ?>
                        <h3 class="tp-services-2-title-2">
                            <?php if ($item['tp_services_link_switcher'] == 'yes') : ?>
                            <a href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_service_title' ]); ?></a>
                            <?php else : ?>
                            <?php echo tp_kses($item['tp_service_title' ]); ?>
                            <?php endif; ?>
                        </h3>
                        <?php endif; ?>

                        <?php if(!empty($item['tp_service_des'])) : ?>
                        <p><?php echo tp_kses($item['tp_service_des']); ?></p>
                        <?php endif; ?>

                        <?php if(!empty($item['tp_service_bottom'])) : ?>
                        <span><i class="fa-solid fa-check"></i> <?php echo tp_kses($item['tp_service_bottom']); ?></span>
                        <?php endif; ?>

                        <?php if(!empty($item['tp_services_btn_text'])) : ?>
                        <div class="tp-servises-2_btn">
                            <a class="blog-btn-2" href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_services_btn_text']); ?></a>
                        </div>
                        <?php endif; ?>

                    </div>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<?php elseif ( $settings['tp_design_style']  == 'layout-4' ) : 
    // shape image
    if ( !empty($settings['tp_shape_image_1']['url']) ) {
        $tp_shape_image = !empty($settings['tp_shape_image_1']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_1']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_1']['url'];
        $tp_shape_image_alt = get_post_meta($settings["tp_shape_image_1"]["id"], "_wp_attachment_image_alt", true);
    }
    $this->add_render_attribute('title_args', 'class', 'tp-section__title mb-10');
?>

    <section class="features-area pt-120 pb-95 p-relative fix tp-el-section">
        <?php if(!empty($tp_shape_image)) : ?>
        <div class="tp-features-3__shap-img">
            <img src="<?php echo esc_url($tp_shape_image); ?>" alt="<?php echo esc_attr($tp_shape_image_alt); ?>">
        </div>
        <?php endif; ?>
        <div class="container">
            <div class="row">
                <div class="col-xl-12">
                    <div class="blog-section-title text-center z-index  pb-50">

                        <?php if ( !empty($settings['tp_services_sub_title']) ) : ?>
                        <div class="tp-section__subtitle mb-15 p-relative"><?php echo tp_kses($settings['tp_services_sub_title']); ?></div>
                        <?php endif; ?>
                        <?php
                        if ( !empty($settings['tp_services_title' ]) ) :
                            printf( '<%1$s %2$s>%3$s</%1$s>',
                            tag_escape( $settings['tp_services_title_tag'] ),
                            $this->get_render_attribute_string( 'title_args' ),
                            tp_kses( $settings['tp_services_title' ] )
                            );
                        endif;
                        ?>
                        <?php if ( !empty($settings['tp_services_description']) ) : ?>
                        <p><?php echo tp_kses( $settings['tp_services_description'] ); ?></p>
                        <?php endif; ?>

                    </div>
                </div>
            </div>
            <div class="row">

                <?php foreach ($settings['tp_service_list'] as $key => $item) :
                    // Link
                    if ('2' == $item['tp_services_link_type']) {
                        $link = get_permalink($item['tp_services_page_link']);
                        $target = '_self';
                        $rel = 'nofollow';
                    } else {
                        $link = !empty($item['tp_services_link']['url']) ? $item['tp_services_link']['url'] : '';
                        $target = !empty($item['tp_services_link']['is_external']) ? '_blank' : '';
                        $rel = !empty($item['tp_services_link']['nofollow']) ? 'nofollow' : '';
                    }
                ?>
                <div class="col-xl-3 col-lg-3 col-md-4 col-sm-6 col-12">

                    <?php if(!empty($item['tp_creative_anima_switcher'])) : ?>
                    <div class="tp-features-3__item mb-30 wow <?php echo esc_attr($item['tp_anima_type']); ?> " data-wow-duration="<?php echo esc_attr($item['tp_anima_dura']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']); ?>">
                    <?php else : ?>
                    <div class="tp-features-3__item mb-30">
                    <?php endif; ?>

                        <?php if($item['tp_box_icon_type'] == 'icon') : ?>
                            <?php if (!empty($item['tp_box_icon']) || !empty($item['tp_box_selected_icon']['value'])) : ?>
                            <span>
                                <?php tp_render_icon($item, 'tp_box_icon', 'tp_box_selected_icon'); ?>
                            </span>
                            <?php endif; ?>
                        <?php elseif( $item['tp_box_icon_type'] == 'image' ) : ?>
                            <?php if (!empty($item['tp_box_icon_image']['url'])): ?>
                            <span>
                                <img src="<?php echo $item['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
                            </span>
                            <?php endif; ?>
                        <?php else : ?>
                            <?php if (!empty($item['tp_box_icon_svg'])): ?>
                            <span>
                                <?php echo $item['tp_box_icon_svg']; ?>
                            </span>
                            <?php endif; ?>
                        <?php endif; ?>

                        <?php if (!empty($item['tp_service_title' ])): ?>
                        <h3 class="tp-features-3-title-3">
                            <?php if ($item['tp_services_link_switcher'] == 'yes') : ?>
                            <a href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_service_title' ]); ?></a>
                            <?php else : ?>
                            <?php echo tp_kses($item['tp_service_title' ]); ?>
                            <?php endif; ?>
                        </h3>
                        <?php endif; ?>
                        <?php if(!empty($item['tp_service_des'])) : ?>
                        <p><?php echo tp_kses($item['tp_service_des']); ?></p>
                        <?php endif; ?>
                    </div>
                </div>
                <?php endforeach; ?>

            </div>
        </div>
    </section>

<?php elseif ( $settings['tp_design_style']  == 'layout-5' ) : 
    $this->add_render_attribute('title_args', 'class', 'tp-section__title mb-10');
?>

<section class="services-area pb-40 tp-el-section">
    <div class="container">
        <div class="row">
            <div class="col-xl-12">
                <div class="blog-section-title text-center z-index  pb-40">
                    <?php if ( !empty($settings['tp_services_sub_title']) ) : ?>
                    <div class="tp-section__subtitle mb-15 p-relative"><?php echo tp_kses($settings['tp_services_sub_title']); ?></div>
                    <?php endif; ?>
                    <?php
                    if ( !empty($settings['tp_services_title' ]) ) :
                        printf( '<%1$s %2$s>%3$s</%1$s>',
                        tag_escape( $settings['tp_services_title_tag'] ),
                        $this->get_render_attribute_string( 'title_args' ),
                        tp_kses( $settings['tp_services_title' ] )
                        );
                    endif;
                    ?>
                    <?php if ( !empty($settings['tp_services_description']) ) : ?>
                    <p><?php echo tp_kses( $settings['tp_services_description'] ); ?></p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div class="row">

            <?php foreach ($settings['tp_service_list'] as $key => $item) :
                // Link
                if ('2' == $item['tp_services_link_type']) {
                    $link = get_permalink($item['tp_services_page_link']);
                    $target = '_self';
                    $rel = 'nofollow';
                } else {
                    $link = !empty($item['tp_services_link']['url']) ? $item['tp_services_link']['url'] : '';
                    $target = !empty($item['tp_services_link']['is_external']) ? '_blank' : '';
                    $rel = !empty($item['tp_services_link']['nofollow']) ? 'nofollow' : '';
                }
                // bg image
                if ( !empty($item['tp_service_bg']['url']) ) {
                    $tp_service_bg = !empty($item['tp_service_bg']['id']) ? wp_get_attachment_image_url( $item['tp_service_bg']['id'], $settings['thumbnail_size']) : $item['tp_service_bg']['url'];
                    $tp_service_bg_alt = get_post_meta($item["tp_service_bg"]["id"], "_wp_attachment_image_alt", true);
                }
            ?>
            <div class="col-xl-4 col-lg-6 col-md-6 col-sm-12">

                <?php if(!empty($item['tp_creative_anima_switcher'])) : ?>
                <div class="tp-services-3__item p-relative mb-30 z-index-1 wow <?php echo esc_attr($item['tp_anima_type']); ?> " data-wow-duration="<?php echo esc_attr($item['tp_anima_dura']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']); ?>">
                <?php else : ?>
                <div class="tp-services-3__item p-relative mb-30 z-index-1">
                <?php endif; ?>

                    <?php if(!empty($tp_service_bg)) : ?>
                    <div class="tp-services-3__thumb p-relative">
                        <img class="w-100" src="<?php echo esc_url($tp_service_bg); ?>" alt="<?php echo esc_attr($tp_service_bg_alt); ?>">
                    </div>
                    <?php endif; ?>

                    <div class="tp-services-3__wrap d-flex align-items-start">

                        <?php if($item['tp_box_icon_type'] == 'icon') : ?>
                            <?php if (!empty($item['tp_box_icon']) || !empty($item['tp_box_selected_icon']['value'])) : ?>
                            <div class="tp-services-3__icon">
                                <span><?php tp_render_icon($item, 'tp_box_icon', 'tp_box_selected_icon'); ?></span>
                            </div>
                            <?php endif; ?>
                        <?php elseif( $item['tp_box_icon_type'] == 'image' ) : ?>
                            <?php if (!empty($item['tp_box_icon_image']['url'])): ?>
                            <div class="tp-services-3__icon">
                                <span><img src="<?php echo $item['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>"></span>
                            </div>
                            <?php endif; ?>
                        <?php else : ?>
                            <?php if (!empty($item['tp_box_icon_svg'])): ?>
                            <div class="tp-services-3__icon">
                                <span><?php echo $item['tp_box_icon_svg']; ?></span>
                            </div>
                            <?php endif; ?>
                        <?php endif; ?>

                        <div class="tp-services-3__content">

                            <?php if (!empty($item['tp_service_title' ])): ?>
                            <h3 class="tp-services-3-title-3">
                                <?php if ($item['tp_services_link_switcher'] == 'yes') : ?>
                                <a href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_service_title' ]); ?></a>
                                <?php else : ?>
                                <?php echo tp_kses($item['tp_service_title' ]); ?>
                                <?php endif; ?>
                            </h3>
                            <?php endif; ?>
                            <?php if(!empty($item['tp_service_des'])) : ?>
                            <p><?php echo tp_kses($item['tp_service_des']); ?></p>
                            <?php endif; ?>
                            <?php if(!empty($item['tp_services_btn_text'])) : ?>
                            <div class="tp-services-3__btn">
                                <a class="tp-services-btn" href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_services_btn_text']); ?><i
                                    class="fa-sharp fa-regular fa-arrow-right"></i></a>
                            </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<?php else:
    // shape image
    if ( !empty($settings['tp_shape_image_1']['url']) ) {
        $tp_shape_image = !empty($settings['tp_shape_image_1']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_1']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_1']['url'];
        $tp_shape_image_alt = get_post_meta($settings["tp_shape_image_1"]["id"], "_wp_attachment_image_alt", true);
    }
    if ( !empty($settings['tp_shape_image_2']['url']) ) {
        $tp_shape_image_2 = !empty($settings['tp_shape_image_2']['id']) ? wp_get_attachment_image_url( $settings['tp_shape_image_2']['id'], $settings['shape_image_size_size']) : $settings['tp_shape_image_2']['url'];
        $tp_shape_image_alt_2 = get_post_meta($settings["tp_shape_image_2"]["id"], "_wp_attachment_image_alt", true);
    }
    $this->add_render_attribute('title_args', 'class', 'tp-section__title mb-10 wow fadeInUp');
    $this->add_render_attribute('title_args', 'data-wow-duration', '.9s');
    $this->add_render_attribute('title_args', 'data-wow-delay', '.4s');
?>

<div class="services-area tp-services__ptb pt-120 pb-90 p-relative fix tp-el-section">
    <?php if(!empty($tp_shape_image)) : ?>
    <div class="tp-services__tran  wow fadeInDownBig ">
        <img src="<?php echo esc_url($tp_shape_image); ?>" alt="<?php echo esc_attr($tp_shape_image_alt); ?>">
    </div>
    <?php endif; ?>
    <?php if(!empty($tp_shape_image_2)) : ?>
    <div class="tp-services__shap">
        <img src="<?php echo esc_url($tp_shape_image_2); ?>" alt="<?php echo esc_attr($tp_shape_image_alt_2); ?>">
    </div>
    <?php endif; ?>
    <div class="container">
        <div class="row">
            <div class="col-xl-4 col-lg-6 col-md-6 col-sm-12 col-12">
                <div class="services-section-title z-index  pb-50">
                    <?php if ( !empty($settings['tp_services_sub_title']) ) : ?>
                    <div class="tp-section__subtitle tp-section__subtitle-before mb-15 p-relative wow fadeInUp " data-wow-duration=".9s" data-wow-delay=".3s">
                        <?php echo tp_kses($settings['tp_services_sub_title']); ?>
                    </div>
                    <?php endif; ?>
                    <?php
                    if ( !empty($settings['tp_services_title' ]) ) :
                        printf( '<%1$s %2$s>%3$s</%1$s>',
                        tag_escape( $settings['tp_services_title_tag'] ),
                        $this->get_render_attribute_string( 'title_args' ),
                        tp_kses( $settings['tp_services_title' ] )
                        );
                    endif;
                    ?>
                    <?php if ( !empty($settings['tp_services_description']) ) : ?>
                    <p><?php echo tp_kses( $settings['tp_services_description'] ); ?></p>
                    <?php endif; ?>
                </div>
            </div>

            <?php foreach ($settings['tp_service_list'] as $key => $item) :
                // Link
                if ('2' == $item['tp_services_link_type']) {
                    $link = get_permalink($item['tp_services_page_link']);
                    $target = '_self';
                    $rel = 'nofollow';
                } else {
                    $link = !empty($item['tp_services_link']['url']) ? $item['tp_services_link']['url'] : '';
                    $target = !empty($item['tp_services_link']['is_external']) ? '_blank' : '';
                    $rel = !empty($item['tp_services_link']['nofollow']) ? 'nofollow' : '';
                }
                // bg image
                if ( !empty($item['tp_service_bg']['url']) ) {
                    $tp_service_bg = !empty($item['tp_service_bg']['id']) ? wp_get_attachment_image_url( $item['tp_service_bg']['id'], 'full') : $item['tp_service_bg']['url'];
                    $tp_service_bg_alt = get_post_meta($item["tp_service_bg"]["id"], "_wp_attachment_image_alt", true);
                }
            ?>
            <div class="col-xl-4 col-lg-6 col-md-6 col-sm-12 col-12">
                <?php if(!empty($item['tp_creative_anima_switcher'])) : ?>
                <div class="tp-services__item p-relative fix mb-30  wow <?php echo esc_attr($item['tp_anima_type']); ?> " data-wow-duration="<?php echo esc_attr($item['tp_anima_dura']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']); ?>">
                <?php else : ?>
                <div class="tp-services__item p-relative fix mb-30 ">
                <?php endif; ?>

                    <?php if(!empty($tp_service_bg)) : ?>
                    <div class="tp-services__hover-img">
                        <img src="<?php echo esc_url($tp_service_bg); ?>" alt="<?php echo esc_attr($tp_service_bg_alt); ?>">
                    </div>
                    <?php endif; ?>

                    <div class="tp-services__wrap z-index-2 d-flex align-items-start">

                        <?php if($item['tp_box_icon_type'] == 'icon') : ?>
                            <?php if (!empty($item['tp_box_icon']) || !empty($item['tp_box_selected_icon']['value'])) : ?>
                            <div class="tp-services__icon">
                                <?php tp_render_icon($item, 'tp_box_icon', 'tp_box_selected_icon'); ?>
                            </div>
                            <?php endif; ?>
                        <?php elseif( $item['tp_box_icon_type'] == 'image' ) : ?>
                            <?php if (!empty($item['tp_box_icon_image']['url'])): ?>
                            <div class="tp-services__icon">
                                <img src="<?php echo $item['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
                            </div>
                            <?php endif; ?>
                        <?php else : ?>
                            <?php if (!empty($item['tp_box_icon_svg'])): ?>
                            <div class="tp-services__icon">
                                <?php echo $item['tp_box_icon_svg']; ?>
                            </div>
                            <?php endif; ?>
                        <?php endif; ?>

                        <div class="tp-services__content">

                            <?php if (!empty($item['tp_service_title' ])): ?>
                            <h3 class="tp-services__title-1">
                                <?php if ($item['tp_services_link_switcher'] == 'yes') : ?>
                                <a href="<?php echo esc_url($link); ?>"><?php echo tp_kses($item['tp_service_title' ]); ?></a>
                                <?php else : ?>
                                <?php echo tp_kses($item['tp_service_title' ]); ?>
                                <?php endif; ?>
                            </h3>
                            <?php endif; ?>

                            <?php if(!empty($item['tp_service_des'])) : ?>
                            <p><?php echo tp_kses($item['tp_service_des']); ?></p>
                            <?php endif; ?>
                        </div>
                        <?php if(!empty($item['tp_service_word'])) : ?>
                        <div class="tp-services__number-count">
                            <span><?php echo tp_kses($item['tp_service_word']); ?></span>
                        </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>

        </div>
    </div>
</div>

<?php endif; 
    }
}

$widgets_manager->register( new TP_Services() ); 

Youez - 2016 - github.com/yon3zu
LinuXploit