PATH:
home
/
centosnipponia
/
public_html
/
sweetrich
/
wp-content
/
themes
/
sydney-pro-ii
/
inc
/
elementor
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor icon list widget. * * Elementor widget that displays a bullet list with any chosen icons and texts. * * @since 1.0.0 */ class aThemes_Elementor_Dual_Buttons extends Widget_Base { /** * Get widget name. * * Retrieve icon list widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'athemes-elementor-dual-buttons'; } /** * Get widget title. * * Retrieve icon list widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __( 'aThemes: Dual buttons', 'sydney' ); } /** * Get widget icon. * * Retrieve icon list widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-button'; } /** * Get widget categories. * * Retrieve the list of categories the icon list widget belongs to. * * Used to determine where to display the widget in the editor. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'sydney-elements' ]; } /** * Register icon list 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->start_controls_section( 'section_first_button', [ 'label' => __( 'First button', 'sydney' ), ] ); $this->add_control( 'text_first', [ 'label' => esc_html__( 'Text', 'sydney' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( 'Start here', 'sydney' ), 'placeholder' => esc_html__( 'Click here', 'sydney' ), ] ); $this->add_control( 'link', [ 'label' => esc_html__( 'Link', 'sydney' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'https://your-link.com', 'sydney' ), 'default' => [ 'url' => '#', ], ] ); $this->add_control( 'selected_icon_first', [ 'label' => esc_html__( 'Icon', 'sydney' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon_first', 'skin' => 'inline', 'label_block' => false, ] ); $this->add_control( 'icon_align_first', [ 'label' => esc_html__( 'Icon Position', 'sydney' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' => esc_html__( 'Before', 'sydney' ), 'right' => esc_html__( 'After', 'sydney' ), ], 'condition' => [ 'selected_icon_first[value]!' => '', ], ] ); $this->add_control( 'icon_indent', [ 'label' => esc_html__( 'Icon Spacing', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view', [ 'label' => esc_html__( 'View', 'sydney' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); //Separator $this->start_controls_section( 'section_separator', [ 'label' => __( 'Separator', 'sydney' ), ] ); $this->add_control( 'text_separator', [ 'label' => esc_html__( 'Text', 'sydney' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( 'or', 'sydney' ), ] ); $this->end_controls_section(); //Second button $this->start_controls_section( 'section_second_button', [ 'label' => __( 'Second button', 'sydney' ), ] ); $this->add_control( 'text_second', [ 'label' => esc_html__( 'Text', 'sydney' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( 'Get in touch', 'sydney' ), 'placeholder' => esc_html__( 'Click here', 'sydney' ), ] ); $this->add_control( 'link_second', [ 'label' => esc_html__( 'Link', 'sydney' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'https://your-link.com', 'sydney' ), 'default' => [ 'url' => '#', ], ] ); $this->add_control( 'selected_icon_second', [ 'label' => esc_html__( 'Icon', 'sydney' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon_second', 'skin' => 'inline', 'label_block' => false, ] ); $this->add_control( 'icon_align_second', [ 'label' => esc_html__( 'Icon Position', 'sydney' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' => esc_html__( 'Before', 'sydney' ), 'right' => esc_html__( 'After', 'sydney' ), ], 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'icon_indent_second', [ 'label' => esc_html__( 'Icon Spacing', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view_second', [ 'label' => esc_html__( 'View', 'sydney' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => esc_html__( 'First button', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button', ] ); $this->start_controls_tabs( 'tabs_button_style' ); $this->start_controls_tab( 'tab_button_normal', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .dual-buttons-first .elementor-button' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'background', 'label' => esc_html__( 'Background', 'elementor' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => '#e64e4e' ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => esc_html__( 'Hover', 'elementor' ), ] ); $this->add_control( 'hover_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dual-buttons-first .elementor-button:hover, {{WRAPPER}} .dual-buttons-first .elementor-button:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .dual-buttons-first .elementor-button:hover svg, {{WRAPPER}} .dual-buttons-first .elementor-button:focus svg' => 'fill: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background_hover', 'label' => esc_html__( 'Background', 'elementor' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button:hover, {{WRAPPER}} .dual-buttons-first .elementor-button:focus', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => 'rgba(230, 76, 76, 0.75)' ], ], ] ); $this->add_control( 'button_hover_border_color', [ 'label' => esc_html__( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-first .elementor-button:hover, {{WRAPPER}} .dual-buttons-first .elementor-button:focus' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => esc_html__( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border', 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button', 'separator' => 'before', ] ); $this->add_control( 'border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-first .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => '{{WRAPPER}} .dual-buttons-first .elementor-button', ] ); $this->add_responsive_control( 'text_padding', [ 'label' => esc_html__( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-first .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', 'desktop_default' => [ 'top' => '18', 'right' => '32', 'bottom' => '18', 'left' => '32', 'unit' => 'px', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_sep_style', [ 'label' => esc_html__( 'Separator', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'sep_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .dual-buttons-sep' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'sep_typography', 'selector' => '{{WRAPPER}} .dual-buttons-sep', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_second', [ 'label' => esc_html__( 'Second button', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography_second', 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow_second', 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button', ] ); $this->start_controls_tabs( 'tabs_button_style_second' ); $this->start_controls_tab( 'tab_button_normal_second', [ 'label' => esc_html__( 'Normal', 'elementor' ), ] ); $this->add_control( 'button_text_color_second', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .dual-buttons-last .elementor-button' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'background_second', 'label' => esc_html__( 'Background', 'elementor' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => '#1c1c1c', ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover_second', [ 'label' => esc_html__( 'Hover', 'elementor' ), ] ); $this->add_control( 'hover_color_second', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .dual-buttons-last .elementor-button:hover, {{WRAPPER}} .dual-buttons-last .elementor-button:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .dual-buttons-last .elementor-button:hover svg, {{WRAPPER}} .dual-buttons-last .elementor-button:focus svg' => 'fill: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background_hover_second', 'label' => esc_html__( 'Background', 'elementor' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button:hover, {{WRAPPER}} .dual-buttons-last .elementor-button:focus', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ 'default' => 'rgba(28, 28, 28, 0.8)', ], ], ] ); $this->add_control( 'button_hover_border_color_second', [ 'label' => esc_html__( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-last .elementor-button:hover, {{WRAPPER}} .dual-buttons-last .elementor-button:focus' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation_second', [ 'label' => esc_html__( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border_second', 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button', 'separator' => 'before', ] ); $this->add_control( 'border_radius_second', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-last .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow_second', 'selector' => '{{WRAPPER}} .dual-buttons-last .elementor-button', ] ); $this->add_responsive_control( 'text_padding_second', [ 'label' => esc_html__( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .dual-buttons-last .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', 'desktop_default' => [ 'top' => '18', 'right' => '32', 'bottom' => '18', 'left' => '32', 'unit' => 'px', ], ] ); $this->end_controls_section(); } /** * Render icon list 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(); //First button if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'first-button', $settings['link'] ); $this->add_render_attribute( 'first-button', 'class', 'elementor-button-link' ); } $this->add_render_attribute( 'first-button', 'class', 'elementor-button' ); $this->add_render_attribute( 'first-button', 'role', 'button' ); //if ( $settings['hover_animation'] ) { //$this->add_render_attribute( 'first-button', 'class', 'elementor-animation-' . $settings['hover_animation'] ); //} //second button if ( ! empty( $settings['link_second']['url'] ) ) { $this->add_link_attributes( 'second-button', $settings['link_second'] ); $this->add_render_attribute( 'second-button', 'class', 'elementor-button-link' ); } $this->add_render_attribute( 'second-button', 'class', 'elementor-button' ); $this->add_render_attribute( 'second-button', 'role', 'button' ); //if ( $settings['hover_animation'] ) { //$this->add_render_attribute( 'second-button', 'class', 'elementor-animation-' . $settings['hover_animation'] ); //} ?> <div class="athemes-ele-block-dual-buttons"> <div class="dual-buttons-first"> <a <?php $this->print_render_attribute_string( 'first-button' ); ?>> <?php $this->render_text( 'first' ); ?> </a> </div> <?php if ( $settings['text_separator'] ) : ?> <div class="dual-buttons-sep"> <?php echo esc_html( $settings['text_separator'] ); ?> </div> <?php endif; ?> <div class="dual-buttons-last"> <a <?php $this->print_render_attribute_string( 'second-button' ); ?>> <?php $this->render_text( 'second' ); ?> </a> </div> </div> <?php } /** * Render icon list 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() { } /** * Render button text. * * Render button widget text. */ protected function render_text( $position ) { $settings = $this->get_settings_for_display(); $migrated = isset( $settings['__fa4_migrated']['selected_icon_' . $position ] ); $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); if ( ! $is_new && empty( $settings['icon_align_' . $position] ) ) { // @todo: remove when deprecated // added as bc in 2.6 //old default $settings['icon_align_' . $position] = $this->get_settings( 'icon_align_' . $position ); } $this->add_render_attribute( [ 'content-wrapper' => [ 'class' => 'elementor-button-content-wrapper', ], 'icon-align' => [ 'class' => [ 'elementor-button-icon', 'elementor-align-icon-' . $settings['icon_align_' . $position], ], ], 'text_' . $position => [ 'class' => 'elementor-button-text', ], ] ); $this->add_inline_editing_attributes( 'text_' . $position, 'none' ); ?> <span <?php $this->print_render_attribute_string( 'content-wrapper' ); ?>> <?php if ( ! empty( $settings['icon_' . $position] ) || ! empty( $settings['selected_icon_' . $position]['value'] ) ) : ?> <span <?php $this->print_render_attribute_string( 'icon-align' ); ?>> <?php if ( $is_new || $migrated ) : Icons_Manager::render_icon( $settings['selected_icon_' . $position], [ 'aria-hidden' => 'true' ] ); else : ?> <i class="<?php echo esc_attr( $settings['icon_' . $position] ); ?>" aria-hidden="true"></i> <?php endif; ?> </span> <?php endif; ?> <span <?php $this->print_render_attribute_string( 'text_' . $position ); ?>><?php $this->print_unescaped_setting( 'text_' . $position ); ?></span> </span> <?php } public function on_import( $element ) { return Icons_Manager::on_import_migration( $element, 'icon_' . $position, 'selected_icon_' . $position ); } } Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Elementor_Dual_Buttons() );
[+]
..
[-] block-animated-heading.php
[edit]
[-] block-contact-form7.php
[edit]
[-] block-dual-buttons.php
[edit]
[-] block-dual-heading.php
[edit]
[-] block-food-menu.php
[edit]
[-] block-hotspots.php
[edit]
[-] block-ninjaforms.php
[edit]
[-] block-wpforms.php
[edit]
[-] .htaccess.disabled
[edit]