PluginProbe
Elementor Website Builder – more than just a page builder / 3.21.3
Elementor Website Builder – more than just a page builder v3.21.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / widgets / button.php

button.php in Elementor Website Builder – more than just a page builder 3.21.3, at includes/widgets/button.php

139 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 use Elementor\Includes\Widgets\Traits\Button_Trait;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor button widget.
12 *
13 * Elementor widget that displays a button with the ability to control every
14 * aspect of the button design.
15 *
16 * @since 1.0.0
17 */
18 class Widget_Button extends Widget_Base {
19
20 use Button_Trait;
21
22 /**
23 * Get widget name.
24 *
25 * Retrieve button widget name.
26 *
27 * @since 1.0.0
28 * @access public
29 *
30 * @return string Widget name.
31 */
32 public function get_name() {
33 return 'button';
34 }
35
36 /**
37 * Get widget title.
38 *
39 * Retrieve button widget title.
40 *
41 * @since 1.0.0
42 * @access public
43 *
44 * @return string Widget title.
45 */
46 public function get_title() {
47 return esc_html__( 'Button', 'elementor' );
48 }
49
50 /**
51 * Get widget icon.
52 *
53 * Retrieve button widget icon.
54 *
55 * @since 1.0.0
56 * @access public
57 *
58 * @return string Widget icon.
59 */
60 public function get_icon() {
61 return 'eicon-button';
62 }
63
64 /**
65 * Get widget categories.
66 *
67 * Retrieve the list of categories the button widget belongs to.
68 *
69 * Used to determine where to display the widget in the editor.
70 *
71 * @since 2.0.0
72 * @access public
73 *
74 * @return array Widget categories.
75 */
76 public function get_categories() {
77 return [ 'basic' ];
78 }
79
80 /**
81 * Get widget upsale data.
82 *
83 * Retrieve the widget promotion data.
84 *
85 * @since 3.19.0
86 * @access protected
87 *
88 * @return array Widget promotion data.
89 */
90 protected function get_upsale_data() {
91 return [
92 'condition' => ! Utils::has_pro(),
93 'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ),
94 'image_alt' => esc_attr__( 'Upgrade', 'elementor' ),
95 'title' => esc_html__( 'Convert visitors into customers', 'elementor' ),
96 'description' => esc_html__( 'Get the Call to Action widget and grow your toolbox with Elementor Pro.', 'elementor' ),
97 'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-button-widget/' ),
98 'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ),
99 ];
100 }
101
102 protected function register_controls() {
103 $this->start_controls_section(
104 'section_button',
105 [
106 'label' => esc_html__( 'Button', 'elementor' ),
107 ]
108 );
109
110 $this->register_button_content_controls();
111
112 $this->end_controls_section();
113
114 $this->start_controls_section(
115 'section_style',
116 [
117 'label' => esc_html__( 'Button', 'elementor' ),
118 'tab' => Controls_Manager::TAB_STYLE,
119 ]
120 );
121
122 $this->register_button_style_controls();
123
124 $this->end_controls_section();
125 }
126
127 /**
128 * Render button widget output on the frontend.
129 *
130 * Written in PHP and used to generate the final HTML.
131 *
132 * @since 1.0.0
133 * @access protected
134 */
135 protected function render() {
136 $this->render_button();
137 }
138 }
139