PluginProbe
Elementor Website Builder – more than just a page builder / 3.2.0
Elementor Website Builder – more than just a page builder v3.2.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 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | includes/widgets/read-more.php +9 -44 4.2.23.2.0 View file →
@@ -8,8 +8,9 @@
8 8 /**
9 9 * Elementor HTML widget.
10 10 *
11 11 * Elementor widget that insert a custom HTML code into the page.
12 + *
12 13 */
13 14 class Widget_Read_More extends Widget_Base {
14 15
15 16 /**
@@ -36,9 +37,9 @@
36 37 *
37 38 * @return string Widget title.
38 39 */
39 40 public function get_title() {
40 - return esc_html__( 'Read More', 'elementor' );
41 + return __( 'Read More', 'elementor' );
41 42 }
42 43
43 44 /**
44 45 * Get widget icon.
@@ -67,16 +68,8 @@
67 68 public function get_keywords() {
68 69 return [ 'read', 'more', 'tag', 'excerpt' ];
69 70 }
70 71
71 - protected function is_dynamic_content(): bool {
72 - return false;
73 - }
74 -
75 - public function has_widget_inner_wrapper(): bool {
76 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
77 - }
78 -
79 72 /**
80 73 * Register HTML widget controls.
81 74 *
82 75 * Adds different input fields to allow the user to change and customize the widget settings.
@@ -87,35 +80,20 @@
87 80 protected function register_controls() {
88 81 $this->start_controls_section(
89 82 'section_title',
90 83 [
91 - 'label' => esc_html__( 'Read More', 'elementor' ),
84 + 'label' => __( 'Read More', 'elementor' ),
92 85 ]
93 86 );
94 87
95 - $default_link_text = esc_html__( 'Continue reading', 'elementor' );
88 + $default_link_text = apply_filters( 'elementor/widgets/read_more/default_link_text', __( 'Continue reading', 'elementor' ) );
96 89
97 - /**
98 - * Read More widgets link text.
99 - *
100 - * Filters the link text in the "Read More" widget.
101 - *
102 - * This hook can be used to set different default text in the widget.
103 - *
104 - * @param string $default_link_text The link text in the "Read More" widget. Default is "Continue reading".
105 - */
106 - $default_link_text = apply_filters( 'elementor/widgets/read_more/default_link_text', $default_link_text );
107 -
108 90 $this->add_control(
109 91 'theme_support',
110 92 [
111 - 'type' => Controls_Manager::ALERT,
112 - 'alert_type' => 'warning',
113 - 'content' => sprintf(
114 - /* translators: %s: The `the_content` function. */
115 - esc_html__( 'Note: This widget only affects themes that use `%s` in archive pages.', 'elementor' ),
116 - 'the_content'
117 - ),
93 + 'type' => Controls_Manager::RAW_HTML,
94 + 'raw' => sprintf( __( 'Note: This widget only affects themes that use `%s` in archive pages.', 'elementor' ), 'the_content' ),
95 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
118 96 ]
119 97 );
120 98
121 99 $this->add_control(
@@ -120,14 +98,11 @@
120 98
121 99 $this->add_control(
122 100 'link_text',
123 101 [
124 - 'label' => esc_html__( 'Read More Text', 'elementor' ),
102 + 'label' => __( 'Read More Text', 'elementor' ),
125 103 'placeholder' => $default_link_text,
126 104 'default' => $default_link_text,
127 - 'dynamic' => [
128 - 'active' => true,
129 - ],
130 105 ]
131 106 );
132 107
133 108 $this->end_controls_section();
@@ -140,9 +115,9 @@
140 115 *
141 116 * @access protected
142 117 */
143 118 protected function render() {
144 - printf( '<!--more %s-->', wp_kses_post( $this->get_settings_for_display( 'link_text' ) ) );
119 + printf( '<!--more %s-->', $this->get_settings_for_display( 'link_text' ) );
145 120 }
146 121
147 122 /**
148 123 * Render Read More widget output in the editor.
@@ -155,16 +130,6 @@
155 130 protected function content_template() {
156 131 ?>
157 132 <!--more {{ settings.link_text }}-->
158 133 <?php
159 - }
160 -
161 - public function render_markdown(): string {
162 - $settings = $this->get_settings_for_display();
163 - $text = Utils::html_to_plain_text( $settings['link_text'] ?? 'Read More' );
164 - $url = ( $settings['link'] ?? [] )['url'] ?? '';
165 - if ( ! empty( $url ) ) {
166 - return '[' . $text . '](' . esc_url( $url ) . ')';
167 - }
168 - return $text;
169 134 }
170 135 }