PluginProbe
Elementor Website Builder – more than just a page builder / 3.29.0-beta4
Elementor Website Builder – more than just a page builder v3.29.0-beta4
4.3.2 4.3.1 4.3.0 4.3.0-beta3 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 All 455 releases
← All changes | modules/atomic-widgets/elements/atomic-button/atomic-button.php +10 -58 4.3.0-beta2 → 3.29.0-beta4 View file →
@@ -2,18 +2,14 @@
2 2
3 3 namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Button;
4 4
5 5 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
6 -use Elementor\Modules\AtomicWidgets\Controls\Types\Inline_Editing_Control;
7 -use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base;
6 +use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;
8 7 use Elementor\Modules\AtomicWidgets\Controls\Section;
9 8 use Elementor\Modules\AtomicWidgets\Controls\Types\Link_Control;
10 -use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template;
11 -use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
9 +use Elementor\Modules\AtomicWidgets\Elements\Has_Template;
12 10 use Elementor\Modules\AtomicWidgets\PropTypes\Background_Prop_Type;
13 -use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
14 11 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
15 -use Elementor\Modules\AtomicWidgets\PropTypes\Escaped_Html_Prop_Type;
16 12 use Elementor\Modules\AtomicWidgets\PropTypes\Color_Prop_Type;
17 13 use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type;
18 14 use Elementor\Modules\AtomicWidgets\PropTypes\Dimensions_Prop_Type;
19 15 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
@@ -19,9 +15,8 @@
19 15 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
20 16 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
21 17 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
22 18 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
23 -use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type;
24 19
25 20 if ( ! defined( 'ABSPATH' ) ) {
26 21 exit;
27 22 }
@@ -44,32 +39,18 @@
44 39 public function get_icon() {
45 40 return 'eicon-e-button';
46 41 }
47 42
48 - public static function get_computed_html_tag( array $settings ): string {
49 - return Html_Tag_Computer::compute( $settings, 'button' );
50 - }
51 -
52 43 protected static function define_props_schema(): array {
53 - $props = [
44 + return [
54 45 'classes' => Classes_Prop_Type::make()
55 46 ->default( [] ),
56 47
57 - 'text' => Escaped_Html_Prop_Type::make()
58 - ->default( __( 'Click here', 'elementor' ) )
59 - ->description( 'The text displayed on the button.' )
60 - ->alias( 'content', 'label' ),
48 + 'text' => String_Prop_Type::make()
49 + ->default( __( 'Click here', 'elementor' ) ),
61 50
62 51 'link' => Link_Prop_Type::make(),
63 -
64 - 'tag' => String_Prop_Type::make()
65 - ->default( 'button' )
66 - ->description( 'The HTML tag for the button element.' ),
67 -
68 - 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
69 52 ];
70 -
71 - return $props;
72 53 }
73 54
74 55 protected function define_atomic_controls(): array {
75 56 return [
@@ -74,32 +55,18 @@
74 55 protected function define_atomic_controls(): array {
75 56 return [
76 57 Section::make()
77 58 ->set_label( __( 'Content', 'elementor' ) )
78 - ->set_id( 'content' )
79 59 ->set_items( [
80 - Inline_Editing_Control::bind_to( 'text' )
81 - ->set_placeholder( __( 'Type your button text here', 'elementor' ) )
82 - ->set_label( __( 'Button text', 'elementor' ) ),
60 + Text_Control::bind_to( 'text' )
61 + ->set_label( __( 'Button text', 'elementor' ) )
62 + ->set_placeholder( __( 'Type your button text here', 'elementor' ) ),
63 +
64 + Link_Control::bind_to( 'link' ),
83 65 ] ),
84 - Section::make()
85 - ->set_label( __( 'Settings', 'elementor' ) )
86 - ->set_id( 'settings' )
87 - ->set_items( $this->get_settings_controls() ),
88 66 ];
89 67 }
90 68
91 - protected function get_settings_controls(): array {
92 - return [
93 - Link_Control::bind_to( 'link' )
94 - ->set_placeholder( __( 'Type or paste your URL', 'elementor' ) )
95 - ->set_label( __( 'Link', 'elementor' ) ),
96 - Text_Control::bind_to( '_cssid' )
97 - ->set_label( __( 'ID', 'elementor' ) )
98 - ->set_meta( $this->get_css_id_control_meta() ),
99 - ];
100 - }
101 -
102 69 protected function define_base_styles(): array {
103 70 $background_color_value = Background_Prop_Type::generate( [
104 71 'color' => Color_Prop_Type::generate( '#375EFB' ),
105 72 ] );
@@ -149,21 +116,6 @@
149 116 protected function get_templates(): array {
150 117 return [
151 118 'elementor/elements/atomic-button' => __DIR__ . '/atomic-button.html.twig',
152 119 ];
153 - }
154 -
155 - public function render_markdown(): string {
156 - $settings = $this->get_atomic_settings();
157 - $text = wp_strip_all_tags( $settings['text'] ?? '' );
158 -
159 - if ( empty( $text ) ) {
160 - return '';
161 - }
162 -
163 - if ( ! empty( $settings['link']['href'] ) ) {
164 - return '[' . $text . '](' . esc_url( $settings['link']['href'] ) . ')';
165 - }
166 -
167 - return '**' . $text . '**';
168 120 }
169 121 }