File manager - Edit - /home/boiitech111/autorollingright.com/wp-content/themes/carutos/inc/vendor/elementor/widgets/heading.php
Back
<?php namespace Elementor; if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } /** * Elementor heading widget. * * Elementor widget that displays an eye-catching headlines. * * @since 1.0.0 */ class OSF_Elementor_Heading extends Widget_Heading { public function get_title() { return esc_html__('Opal Heading', 'erios-core'); } protected function register_controls() { $this->start_controls_section( 'section_title', [ 'label' => esc_html__('Title', 'erios-core'), ] ); $this->add_control( 'title', [ 'label' => esc_html__('Title', 'erios-core'), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__('Enter your title', 'erios-core'), 'default' => esc_html__('Add Your Heading Text Here', 'erios-core'), ] ); $this->add_control( 'link', [ 'label' => esc_html__('Link', 'erios-core'), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => '', ], 'separator' => 'before', ] ); $this->add_control( 'size', [ 'label' => esc_html__('Size', 'erios-core'), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__('Default', 'erios-core'), 'small' => esc_html__('Small', 'erios-core'), 'medium' => esc_html__('Medium', 'erios-core'), 'large' => esc_html__('Large', 'erios-core'), 'xl' => esc_html__('XL', 'erios-core'), 'xxl' => esc_html__('XXL', 'erios-core'), ], ] ); $this->add_control( 'header_size', [ 'label' => esc_html__('HTML Tag', 'erios-core'), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h2', ] ); $this->add_control( 'show_decor', [ 'label' => esc_html__('Show Decor', 'erios-core'), 'type' => Controls_Manager::SWITCHER, ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__('Alignment', 'erios-core'), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'erios-core'), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'erios-core'), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__('Right', 'erios-core'), 'icon' => 'fa fa-align-right', ], 'justify' => [ 'title' => esc_html__('Justified', 'erios-core'), 'icon' => 'fa fa-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], 'prefix_class' => 'elementor%s-align-', ] ); $this->add_control( 'view', [ 'label' => esc_html__('View', 'erios-core'), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => esc_html__('Title', 'erios-core'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => esc_html__('Text Color', 'erios-core'), 'type' => Controls_Manager::COLOR, 'selectors' => [ // Stronger selector to avoid section style from overwriting '{{WRAPPER}}.elementor-widget-heading .elementor-heading-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'selector' => '{{WRAPPER}} .elementor-heading-title', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} .elementor-heading-title', ] ); $this->add_control( 'blend_mode', [ 'label' => esc_html__('Blend Mode', 'erios-core'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__('Normal', 'erios-core'), 'multiply' => 'Multiply', 'screen' => 'Screen', 'overlay' => 'Overlay', 'darken' => 'Darken', 'lighten' => 'Lighten', 'color-dodge' => 'Color Dodge', 'saturation' => 'Saturation', 'color' => 'Color', 'difference' => 'Difference', 'exclusion' => 'Exclusion', 'hue' => 'Hue', 'luminosity' => 'Luminosity', ], 'selectors' => [ '{{WRAPPER}} .elementor-heading-title' => 'mix-blend-mode: {{VALUE}}', ], 'separator' => 'none', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_decor_style', [ 'label' => esc_html__('Decor', 'erios-core'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_decor' => 'yes' ] ] ); $this->add_control( 'decor_color', [ 'label' => esc_html__('Decor Color', 'erios-core'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .heading-decor svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'decor_size', [ 'label' => esc_html__('Size', 'erios-core'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .heading-decor svg' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'decor_spacing', [ 'label' => esc_html__('Spacing', 'erios-core'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .heading-decor' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Render heading 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(); if (empty($settings['title'])) { return; } $this->add_render_attribute('title', 'class', 'elementor-heading-title'); if (!empty($settings['size'])) { $this->add_render_attribute('title', 'class', 'elementor-size-' . $settings['size']); } $this->add_inline_editing_attributes('title'); $title = ''; $title_html = ''; if ($settings['show_decor'] == 'yes') { $title .= '<div class="heading-icon heading-decor"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 18"><g class="nc-icon-wrapper"><g class="st0"><path class="st1" d="M9.96 2.98L7.99 1.01-.01 9l8 7.99 2-1.99-6.02-6.03z" fill-rule="evenodd" clip-rule="evenodd" fill="#D81324"></path></g><g class="st0"><path class="st2" d="M12.97-.03l-9 9 8.99 9.01 8.99-9.01-8.98-9zm-7.5 9l7.5-7.51 7.5 7.51-7.5 7.51-7.5-7.51z" fill="#AFB5BB"></path></g></g></svg></div>'; } $title .= $settings['title']; if (!empty($settings['link']['url'])) { $this->add_render_attribute('url', 'href', $settings['link']['url']); if ($settings['link']['is_external']) { $this->add_render_attribute('url', 'target', '_blank'); } if (!empty($settings['link']['nofollow'])) { $this->add_render_attribute('url', 'rel', 'nofollow'); } $title = sprintf('<a %1$s>%2$s</a>', $this->get_render_attribute_string('url'), $title); } echo sprintf('<%1$s %2$s>%3$s</%1$s>', $settings['header_size'], $this->get_render_attribute_string('title'), $title); // WPCS: XSS ok. } /** * Render heading widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 1.0.0 * @access protected */ protected function _content_template() { ?> <# var title = ''; var title_html = ''; if(settings.show_decor !== '') { title += '<div class="heading-icon heading-decor"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 18"><g class="nc-icon-wrapper"><g class="st0"><path class="st1" d="M9.96 2.98L7.99 1.01-.01 9l8 7.99 2-1.99-6.02-6.03z" fill-rule="evenodd" clip-rule="evenodd" fill="#D81324"></path></g><g class="st0"><path class="st2" d="M12.97-.03l-9 9 8.99 9.01 8.99-9.01-8.98-9zm-7.5 9l7.5-7.51 7.5 7.51-7.5 7.51-7.5-7.51z" fill="#AFB5BB"></path></g></g></svg></div>'; } title += settings.title; if ( '' !== settings.link.url ) { title = '<a href="' + settings.link.url + '">' + title + '</a>'; } view.addRenderAttribute( 'title', 'class', [ 'elementor-heading-title', 'elementor-size-' + settings.size ] ); view.addInlineEditingAttributes( 'title' ); title_html += '<' + settings.header_size + ' ' + view.getRenderAttributeString( 'title' ) + '>' + title + '</' + settings.header_size + '>'; print( title_html ); #> <?php } } $widgets_manager->register(new OSF_Elementor_Heading());
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings