PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.1
Elementor Website Builder – more than just a page builder v4.3.1
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 4.0.8 All 454 releases
← All changes | modules/atomic-widgets/elements/atomic-heading/atomic-heading.php +19 -9 4.1.0 → 4.3.1 View file →
@@ -7,11 +7,12 @@
7 7 use Elementor\Modules\AtomicWidgets\Controls\Types\Select_Control;
8 8 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
9 9 use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base;
10 10 use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template;
11 +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
11 12 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
12 13 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
13 -use Elementor\Modules\AtomicWidgets\PropTypes\Html_V3_Prop_Type;
14 +use Elementor\Modules\AtomicWidgets\PropTypes\Escaped_Html_Prop_Type;
14 15 use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type;
15 16 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
16 17 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
17 18 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
@@ -37,9 +38,9 @@
37 38 return esc_html__( 'Heading', 'elementor' );
38 39 }
39 40
40 41 public function get_keywords() {
41 - return [ 'ato', 'atom', 'atoms', 'atomic' ];
42 + return [ 'ato', 'atom', 'atoms', 'atomic', 'heading', 'title', 'text', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];
42 43 }
43 44
44 45 public function get_icon() {
45 46 return 'eicon-e-heading';
@@ -44,8 +45,18 @@
44 45 public function get_icon() {
45 46 return 'eicon-e-heading';
46 47 }
47 48
49 + public static function html_tag_follows_link(): bool {
50 + return false;
51 + }
52 +
53 + public static function get_computed_html_tag( array $settings ): string {
54 + return Html_Tag_Computer::compute( $settings, 'h2', [
55 + Html_Tag_Computer::FOLLOW_LINK_OPTION => static::html_tag_follows_link(),
56 + ] );
57 + }
58 +
48 59 protected static function define_props_schema(): array {
49 60 return [
50 61 'classes' => Classes_Prop_Type::make()
51 62 ->default( [] ),
@@ -52,16 +63,14 @@
52 63
53 64 'tag' => String_Prop_Type::make()
54 65 ->enum( [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ] )
55 66 ->default( 'h2' )
56 - ->description( 'The HTML tag for the heading element. Could be h1, h2, up to h6' ),
67 + ->description( 'The HTML tag for the heading element. One of: h1, h2, h3, h4, h5, or h6. Do not use p, span, or div.' ),
57 68
58 - 'title' => Html_V3_Prop_Type::make()
59 - ->default( [
60 - 'content' => String_Prop_Type::generate( __( 'This is a title', 'elementor' ) ),
61 - 'children' => [],
62 - ] )
63 - ->description( 'The text content of the heading.' ),
69 + 'title' => Escaped_Html_Prop_Type::make()
70 + ->default( __( 'This is a title', 'elementor' ) )
71 + ->description( 'The text content of the heading.' )
72 + ->alias( 'text', 'content', 'heading' ),
64 73
65 74 'link' => Link_Prop_Type::make(),
66 75
67 76 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
@@ -70,8 +79,9 @@
70 79
71 80 protected function define_atomic_controls(): array {
72 81 $content_section = Section::make()
73 82 ->set_label( __( 'Content', 'elementor' ) )
83 + ->set_id( 'content' )
74 84 ->set_items( [
75 85 Inline_Editing_Control::bind_to( 'title' )
76 86 ->set_placeholder( __( 'Type your title here', 'elementor' ) )
77 87 ->set_label( __( 'Title', 'elementor' ) ),