PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.2
Elementor Website Builder – more than just a page builder v3.4.2
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
← All changes | includes/widgets/google-maps.php +24 -48 4.1.0-dev23.4.2 View file →
@@ -87,31 +87,9 @@
87 87 public function get_keywords() {
88 88 return [ 'google', 'map', 'embed', 'location' ];
89 89 }
90 90
91 - protected function is_dynamic_content(): bool {
92 - return false;
93 - }
94 -
95 91 /**
96 - * Get style dependencies.
97 - *
98 - * Retrieve the list of style dependencies the widget requires.
99 - *
100 - * @since 3.24.0
101 - * @access public
102 - *
103 - * @return array Widget style dependencies.
104 - */
105 - public function get_style_depends(): array {
106 - return [ 'widget-google_maps' ];
107 - }
108 -
109 - public function has_widget_inner_wrapper(): bool {
110 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
111 - }
112 -
113 - /**
114 92 * Register google maps widget controls.
115 93 *
116 94 * Adds different input fields to allow the user to change and customize the widget settings.
117 95 *
@@ -121,9 +99,9 @@
121 99 protected function register_controls() {
122 100 $this->start_controls_section(
123 101 'section_map',
124 102 [
125 - 'label' => esc_html__( 'Google Maps', 'elementor' ),
103 + 'label' => esc_html__( 'Map', 'elementor' ),
126 104 ]
127 105 );
128 106
129 107 if ( Plugin::$instance->editor->is_edit_mode() ) {
@@ -132,17 +110,15 @@
132 110 if ( ! $api_key ) {
133 111 $this->add_control(
134 112 'api_key_notification',
135 113 [
136 - 'type' => Controls_Manager::ALERT,
137 - 'alert_type' => 'info',
138 - 'content' => sprintf(
139 - /* translators: 1: Integration settings link open tag, 2: Create API key link open tag, 3: Link close tag. */
140 - esc_html__( 'Set your Google Maps API Key in Elementor\'s %1$sIntegrations Settings%3$s page. Create your key %2$shere.%3$s', 'elementor' ),
141 - '<a href="' . Settings::get_settings_tab_url( 'integrations' ) . '" target="_blank">',
142 - '<a href="https://developers.google.com/maps/documentation/embed/get-api-key" target="_blank">',
143 - '</a>'
114 + 'type' => Controls_Manager::RAW_HTML,
115 + 'raw' => sprintf(
116 + esc_html__( 'Set your Google Maps API Key in Elementor\'s <a href="%1$s" target="_blank">Integrations Settings</a> page. Create your key <a href="%2$s" target="_blank">here.', 'elementor' ),
117 + Settings::get_url() . '#tab-integrations',
118 + 'https://developers.google.com/maps/documentation/embed/get-api-key'
144 119 ),
120 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
145 121 ]
146 122 );
147 123 }
148 124 }
@@ -158,11 +134,8 @@
158 134 'categories' => [
159 135 TagsModule::POST_META_CATEGORY,
160 136 ],
161 137 ],
162 - 'ai' => [
163 - 'active' => false,
164 - ],
165 138 'placeholder' => $default_address,
166 139 'default' => $default_address,
167 140 'label_block' => true,
168 141 ]
@@ -195,10 +168,14 @@
195 168 'px' => [
196 169 'min' => 40,
197 170 'max' => 1440,
198 171 ],
172 + 'vh' => [
173 + 'min' => 0,
174 + 'max' => 100,
175 + ],
199 176 ],
200 - 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ],
177 + 'size_units' => [ 'px', 'vh' ],
201 178 'selectors' => [
202 179 '{{WRAPPER}} iframe' => 'height: {{SIZE}}{{UNIT}};',
203 180 ],
204 181 ]
@@ -203,14 +180,23 @@
203 180 ],
204 181 ]
205 182 );
206 183
184 + $this->add_control(
185 + 'view',
186 + [
187 + 'label' => esc_html__( 'View', 'elementor' ),
188 + 'type' => Controls_Manager::HIDDEN,
189 + 'default' => 'traditional',
190 + ]
191 + );
192 +
207 193 $this->end_controls_section();
208 194
209 195 $this->start_controls_section(
210 196 'section_map_style',
211 197 [
212 - 'label' => esc_html__( 'Google Maps', 'elementor' ),
198 + 'label' => esc_html__( 'Map', 'elementor' ),
213 199 'tab' => Controls_Manager::TAB_STYLE,
214 200 ]
215 201 );
216 202
@@ -248,13 +234,12 @@
248 234
249 235 $this->add_control(
250 236 'hover_transition',
251 237 [
252 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
238 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
253 239 'type' => Controls_Manager::SLIDER,
254 240 'range' => [
255 241 'px' => [
256 - 'min' => 0,
257 242 'max' => 3,
258 243 'step' => 0.1,
259 244 ],
260 245 ],
@@ -306,9 +291,9 @@
306 291 }
307 292
308 293 ?>
309 294 <div class="elementor-custom-embed">
310 - <iframe loading="lazy"
295 + <iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
311 296 src="<?php echo esc_url( vsprintf( $url, $params ) ); ?>"
312 297 title="<?php echo esc_attr( $settings['address'] ); ?>"
313 298 aria-label="<?php echo esc_attr( $settings['address'] ); ?>"
314 299 ></iframe>
@@ -324,14 +309,5 @@
324 309 * @since 2.9.0
325 310 * @access protected
326 311 */
327 312 protected function content_template() {}
328 -
329 - public function render_markdown(): string {
330 - $settings = $this->get_settings_for_display();
331 - $address = Utils::html_to_plain_text( $settings['address'] ?? '' );
332 - if ( empty( $address ) ) {
333 - return '';
334 - }
335 - return '[Map: ' . $address . '](https://maps.google.com/maps?q=' . rawurlencode( $address ) . ')';
336 - }
337 313 }