PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
elementor
/
widgets
<?php namespace Elementor; class Webnus_Element_Widgets_Button extends \Elementor\Widget_Base { /** * Retrieve widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'wn_button'; } /** * Retrieve widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'Webnus Buttons', 'deep' ); } /** * Retrieve widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-button'; } /** * Set widget category. * * @since 1.0.0 * @access public * * @return array Widget category. */ public function get_categories() { return [ 'webnus' ]; } /** * Register widget controls. * * * @since 1.0.0 * @access protected */ protected function _register_controls() { // Content Tab $this->start_controls_section( 'content_section', [ 'label' => esc_html__( 'General', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'btn_content', //param_name [ 'label' => esc_html__( 'Button text', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::TEXT, //type 'default' => esc_html__( 'Button', 'deep'), ] ); $this->add_control( 'link', //param_name [ 'label' => esc_html__( 'Button link', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::URL, //type 'placeholder' => esc_html__( 'https://your-link.com', 'deep' ), 'show_external' => true, 'default' => [ 'url' => '', 'is_external' => true, 'nofollow' => true, ], ] ); $this->end_controls_section(); // Styling $this->start_controls_section( 'style_section', [ 'label' => esc_html__( 'Styling', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'shape', [ 'label' => esc_html__( 'Shape', 'deep' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ "" => "Default", "square" => "Square", "rounded" => "Rounded", ], ] ); $this->add_control( 'size', [ 'label' => esc_html__( 'Size', 'deep' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ 'small' => "Small", 'medium'=> 'Medium', 'large' => 'Large', ], 'default' => 'medium' ] ); $this->add_control( 'border', //param_name [ 'label' => esc_html__( 'Bordered', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::SWITCHER, //type 'label_on' => esc_html__( 'Enable', 'deep' ), 'label_off' => esc_html__( 'Disable', 'deep' ), 'return_value' => 'true', 'default' => 'false' ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_text_font', 'label' => __( 'Typography', 'deep' ), 'selector' => '{{WRAPPER}} a.button', ] ); $this->add_control( 'botton_skin', [ 'label' => esc_html__( 'Button Skin', 'deep' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ "predefined" => "Predefined", "custom" => "Custom", ], 'default' => 'predefined', ] ); $this->add_control( 'color', [ 'label' => esc_html__( 'Color', 'deep' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ "theme-skin" => "Default", "green" => "Green", "gold" => "Gold", "red" => "Red", "blue" => "Blue", "gray" => "Gray", "dark-gray" => "Dark gray", "cherry" => "Cherry", "orchid" => "Orchid", "pink" => "Pink", "orange" => "Orange", "teal" => "Teal", "skyblue" => "SkyBlue", "jade" => "Jade", "white" => "White", "black" => "Black", ], 'default' => 'theme-skin', 'condition' => [ 'botton_skin' => [ 'predefined' ] ] ] ); $this->add_control( 'hr', [ 'type' => \Elementor\Controls_Manager::DIVIDER, 'style' => 'thick', 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->start_controls_tabs( 'wn_style_tabs' ); $this->start_controls_tab( 'style_normal_tab', [ 'label' => __( 'Normal', 'deep' ), 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->add_control( 'btn_color', //param_name [ 'label' => esc_html__( 'Text Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'condition' => [ 'botton_skin' => [ 'custom' ] ], 'selectors' => [ '{{WRAPPER}} a.button' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'btn_border_color', //param_name [ 'label' => esc_html__( 'Border color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'condition' => [ 'botton_skin' => [ 'custom' ] ], 'selectors' => [ '{{WRAPPER}} a.button' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_background', 'label' => esc_html__( 'Background', 'deep' ), 'types' => [ 'classic', 'gradient', ], 'selector' => '{{WRAPPER}} a.button', 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'style_hover_tab', [ 'label' => __( 'Hover', 'deep' ), 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->add_control( 'btn_color_hover', //param_name [ 'label' => esc_html__( 'Text Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'condition' => [ 'botton_skin' => [ 'custom' ] ], 'selectors' => [ '{{WRAPPER}} a.button:hover' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'btn_border_color_hover', //param_name [ 'label' => esc_html__( 'Border color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'condition' => [ 'botton_skin' => [ 'custom' ] ], 'selectors' => [ '{{WRAPPER}} a.button:hover' => 'border-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_background_hover', 'label' => esc_html__( 'Background Hover', 'deep' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} a.button:hover', 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'hr1', [ 'type' => \Elementor\Controls_Manager::DIVIDER, 'style' => 'thick', 'condition' => [ 'botton_skin' => [ 'custom' ] ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => esc_html__( 'Box Shadow', 'deep' ), 'selector' => '{{WRAPPER}} a.button', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border', 'label' => __( 'Button Border', 'deep' ), 'selector' => '{{WRAPPER}} a.button', ] ); $this->add_control( 'button_border_radius', //param_name [ 'label' => __( 'Button Border Radius', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_padding', //param_name [ 'label' => esc_html__( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units'=> [ 'px', 'em', '%' ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} a.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_margin', //param_name [ 'label' => esc_html__( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units'=> [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow_hover', 'label' => esc_html__( 'Box Shadow Hover', 'deep' ), 'selector' => '{{WRAPPER}} a.button:hover', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border_hover', 'label' => __( 'Button Border Hover', 'deep' ), 'selector' => '{{WRAPPER}} a.button:hover', ] ); $this->add_control( 'button_border_radius_hover', //param_name [ 'label' => __( 'Button Border Radius Hover', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_padding_hover', //param_name [ 'label' => esc_html__( 'Padding Hover', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units'=> [ 'px', 'em', '%' ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} a.button:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_margin_hover', //param_name [ 'label' => esc_html__( 'Margin Hover', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'size_units'=> [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'button_arrow', //param_name [ 'label' => esc_html__( 'Have Arrow when hover?', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::SWITCHER, //type 'label_on' => esc_html__( 'Yes', 'deep' ), 'label_off' => esc_html__( 'No', 'deep' ), 'return_value' => 'yes', ] ); $this->add_control( 'btn_arrow_icon_color', //param_name [ 'label' => esc_html__( 'Icon Arrow Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '{{WRAPPER}} .button.arrow:hover::before' => 'color: {{VALUE}}', ], 'condition' => [ 'button_arrow' => [ 'yes' ] ], ] ); $this->add_control( 'vertical_align', [ 'label' => esc_html__( 'Icon Vertical Alignment', 'deep' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => [ 'top' => 'Top', 'middle' => 'Middle', 'bottom' => 'Bottom', ], 'default' => 'middle', 'selectors' => [ '{{WRAPPER}} a.button i' => 'vertical-align: {{VALUE}};', ], ] ); $this->add_control( 'icon_font_size', [ 'label' => __( 'Icon Font Size', 'deep' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 18, ], 'selectors' => [ '#wrap {{WRAPPER}} a.button i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'btn_icon_color', //param_name [ 'label' => esc_html__( 'Icon Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '{{WRAPPER}} a.button i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'btn_icon_color_hover', //param_name [ 'label' => esc_html__( 'Hover Button Icon Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '{{WRAPPER}} a.button:hover i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'icon_padding', //param_name [ 'label' => esc_html__( 'Icon Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'icon_margin', //param_name [ 'label' => esc_html__( 'Icon Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} a.button i' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); //Icon $this->start_controls_section( 'icon_section', [ 'label' => esc_html__( 'Icon', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'deep' ), 'type' => \Elementor\Controls_Manager::ICON, ] ); $this->end_controls_section(); // Class & ID Tab $this->start_controls_section( 'class_id_section', [ 'label' => esc_html__( 'Class & ID', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'shortcodeclass', [ 'label' => esc_html__( 'Extra Class', 'deep' ), 'type' => \Elementor\Controls_Manager::TEXT, ] ); $this->add_control( 'shortcodeid', [ 'label' => esc_html__( 'ID', 'deep' ), 'type' => \Elementor\Controls_Manager::TEXT, ] ); $this->end_controls_section(); // Custom css tab $this->start_controls_section( 'custom_css_section', [ 'label' => __( 'Custom CSS', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'custom_css', [ 'label' => __( 'Custom CSS', 'deep' ), 'type' => \Elementor\Controls_Manager::CODE, 'language' => 'css', 'rows' => 20, 'show_label' => true, ] ); $this->end_controls_section(); } /** * Render Sermon Category widget output on the frontend. * * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings(); // Variables $shortcodeclass = $settings['shortcodeclass'] ? $settings['shortcodeclass'] : ''; $shortcodeid = $settings['shortcodeid'] ? ' id="' . $settings['shortcodeid'] . '"' : ''; $shape = $settings['shape']; $btn_content = $settings['btn_content']; $link = $settings['link']['url']; $size = $settings['size']; $border = $settings['border']; $button_arrow = $settings['button_arrow']; $botton_skin = $settings['botton_skin']; $color = $settings['color']; $btn_padding = $settings['btn_padding']; $btn_margin = $settings['btn_margin']; $btn_color = $settings['btn_color']; $btn_color_hover = $settings['btn_color_hover']; $btn_border_color = $settings['btn_border_color']; $btn_border_color_hover = $settings['btn_border_color_hover']; $icon = $settings['icon']; $target = $settings['link']['is_external'] ? ' target="_blank"' : ''; $nofollow = $settings['link']['nofollow'] ? ' rel="nofollow"' : ''; if ( empty($color) ) $color = 'theme-skin'; if ( empty($botton_skin) ) $botton_skin = 'predefined'; $set_arrow = ''; if( $button_arrow == "yes" ) { $set_arrow = 'arrow'; } $btn_bg = $btn_bg_hover = ''; // btn google fonts $btn_color = $btn_color ? 'color: ' . $btn_color . ' !important;' : ''; $btn_color_hover = $btn_color_hover ? 'color: ' . $btn_color_hover . ' !important;' : ''; $btn_border_color = $btn_border_color ? 'border-color:' . $btn_border_color . ' !important;' : ''; $btn_border_color_hover = $btn_border_color_hover ? 'border-color:' . $btn_border_color_hover . ' !important;' : ''; $predefined = ($botton_skin == 'predefined') ? $color : ''; $custom = ($botton_skin == 'custom') ? $btn_color . $btn_border_color : ''; $custom_hover = ($botton_skin == 'custom') ? $btn_border_color_hover . $btn_bg_hover : ''; $link = $link ? $link : ''; $border = ( 'true' == $border ) ? 'bordered-bot' : ''; $icon_str = !empty($icon)? '<i class="'.$icon.'"></i>' : ''; $out = ' <a href="'. $link . '" class="button ' .$predefined.' '.$shape.' '.$size.' '.$border.' '.$set_arrow.' ' . $shortcodeclass . '" ' . $shortcodeid . $target . $nofollow . '><span>'. $icon_str . $btn_content . '</span></a>'; $custom_css = $settings['custom_css']; if ( $custom_css != '' ) { echo '<style>'. $custom_css .'</style>'; } echo $out; } }
[+]
..
[-] our-client.php
[edit]
[-] icons.php
[edit]
[-] collection.php
[edit]
[-] testimonial-tab.php
[edit]
[-] teaserbox.php
[edit]
[-] instagram.php
[edit]
[-] our-team.php
[edit]
[-] content-carousel.php
[edit]
[-] videoteaser.php
[edit]
[-] like-view-share.php
[edit]
[-] courses-instructors.php
[edit]
[-] widget-flickr.php
[edit]
[-] reservation.php
[edit]
[-] list.php
[edit]
[-] road-map.php
[edit]
[-] max-counter.php
[edit]
[-] magazine.php
[edit]
[-] prayer-wall-items.php
[edit]
[-] facebook-button.php
[edit]
[-] icon-divider.php
[edit]
[-] featured-products.php
[edit]
[-] review-items.php
[edit]
[-] iconbox.php
[edit]
[-] widget-googleplus.php
[edit]
[-] content-slider.php
[edit]
[-] service-carousel.php
[edit]
[-] contact-form.php
[edit]
[-] twitter-feed.php
[edit]
[-] blog.php
[edit]
[-] process-carousel.php
[edit]
[-] course-category.php
[edit]
[-] virtual-coins.php
[edit]
[-] speakers.php
[edit]
[-] the-grid.php
[edit]
[-] custom-menu.php
[edit]
[-] widget-youtube.php
[edit]
[-] testimonial.php
[edit]
[-] callout.php
[edit]
[-] testimonial-slider.php
[edit]
[-] category-tab.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] button.php
[edit]
[-] facebook-comments.php
[edit]
[-] widget-login.php
[edit]
[-] subscribe.php
[edit]
[-] googlemap.php
[edit]
[-] widget-social-icon.php
[edit]
[-] postslider.php
[edit]
[-] alert.php
[edit]
[-] video-play-button.php
[edit]
[-] quote.php
[edit]
[-] donate.php
[edit]
[-] dropcap.php
[edit]
[-] before-after-image.php
[edit]
[-] pricing-tables.php
[edit]
[-] facebook-page.php
[edit]
[-] shop-products.php
[edit]
[-] single-goal.php
[edit]
[-] info-box.php
[edit]
[-] latestfromblog.php
[edit]
[-] goals.php
[edit]
[-] revolution-slider.php
[edit]
[-] widget-subscribe.php
[edit]
[-] tablepress.php
[edit]
[-] tab-content.php
[edit]
[-] schedule.php
[edit]
[-] sermon-category.php
[edit]
[-] pricing-plan.php
[edit]
[-] tabs.php
[edit]
[-] widget-latest-posts.php
[edit]
[-] distance.php
[edit]
[-] widget-popular-posts.php
[edit]
[-] recipes.php
[edit]
[-] causes.php
[edit]
[-] widget-testimonial.php
[edit]
[-] widget-about.php
[edit]
[-] special-offers.php
[edit]
[-] tooltip.php
[edit]
[-] food-menu.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] widget-tab.php
[edit]
[-] courses.php
[edit]
[-] login.php
[edit]
[-] post-from-blog.php
[edit]
[-] socials.php
[edit]
[-] line.php
[edit]
[-] gallery.php
[edit]
[-] faq.php
[edit]
[-] piecharts.php
[edit]
[-] image-hotspot.php
[edit]
[-] link.php
[edit]
[-] prayer-wall-form.php
[edit]
[-] rooms.php
[edit]
[-] countdown.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] facebook-embed.php
[edit]
[-] single-cause.php
[edit]
[-] review-form.php
[edit]
[-] buy-process.php
[edit]
[-] sermons.php
[edit]
[-] widget-facebook.php
[edit]
[-] single-sermon.php
[edit]
[-] single-course.php
[edit]
[-] image-carousel.php
[edit]
[-] toggle-box.php
[edit]
[-] our-process.php
[edit]
[-] svg.php
[edit]
[-] w-title.php
[edit]
[-] block-quote.php
[edit]