PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.4
Elementor Website Builder – more than just a page builder v3.0.4
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/controls/groups/image-size.php +9 -33 4.1.0-dev23.0.4 View file →
@@ -99,9 +99,9 @@
99 99 $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode();
100 100
101 101 // On static mode don't use WP responsive images.
102 102 if ( ! empty( $image['id'] ) && in_array( $size, $image_sizes ) && ! $is_static_render_mode ) {
103 - $image_class .= " attachment-$size size-$size wp-image-{$image['id']}";
103 + $image_class .= " attachment-$size size-$size";
104 104 $image_attr = [
105 105 'class' => trim( $image_class ),
106 106 ];
107 107
@@ -113,17 +113,11 @@
113 113 $image_src = $image['url'];
114 114 }
115 115
116 116 if ( ! empty( $image_src ) ) {
117 - $image_class_html = ! empty( $image_class ) ? ' class="' . esc_attr( $image_class ) . '"' : '';
117 + $image_class_html = ! empty( $image_class ) ? ' class="' . $image_class . '"' : '';
118 118
119 - $html .= sprintf(
120 - '<img src="%1$s" title="%2$s" alt="%3$s"%4$s loading="lazy" />',
121 - esc_url( $image_src ),
122 - esc_attr( Control_Media::get_image_title( $image ) ),
123 - esc_attr( Control_Media::get_image_alt( $image ) ),
124 - $image_class_html
125 - );
119 + $html .= sprintf( '<img src="%s" title="%s" alt="%s"%s />', esc_attr( $image_src ), Control_Media::get_image_title( $image ), Control_Media::get_image_alt( $image ), $image_class_html );
126 120 }
127 121 }
128 122
129 123 /**
@@ -143,27 +137,8 @@
143 137 return apply_filters( 'elementor/image_size/get_attachment_image_html', $html, $settings, $image_size_key, $image_key );
144 138 }
145 139
146 140 /**
147 - * Safe print attachment image HTML.
148 - *
149 - * @uses get_attachment_image_html.
150 - *
151 - * @access public
152 - * @static
153 - *
154 - * @param array $settings Control settings.
155 - * @param string $image_size_key Optional. Settings key for image size.
156 - * Default is `image`.
157 - * @param string $image_key Optional. Settings key for image. Default
158 - * is null. If not defined uses image size key
159 - * as the image key.
160 - */
161 - public static function print_attachment_image_html( array $settings, $image_size_key = 'image', $image_key = null ) {
162 - Utils::print_wp_kses_extended( self::get_attachment_image_html( $settings, $image_size_key, $image_key ), [ 'image' ] );
163 - }
164 -
165 - /**
166 141 * Get all image sizes.
167 142 *
168 143 * Retrieve available image sizes with data like `width`, `height` and `crop`.
169 144 *
@@ -292,19 +267,20 @@
292 267 protected function init_fields() {
293 268 $fields = [];
294 269
295 270 $fields['size'] = [
296 - 'label' => esc_html__( 'Image Resolution', 'elementor' ),
271 + 'label' => _x( 'Image Size', 'Image Size Control', 'elementor' ),
297 272 'type' => Controls_Manager::SELECT,
298 273 ];
299 274
300 275 $fields['custom_dimension'] = [
301 - 'label' => esc_html__( 'Image Dimension', 'elementor' ),
276 + 'label' => _x( 'Image Dimension', 'Image Size Control', 'elementor' ),
302 277 'type' => Controls_Manager::IMAGE_DIMENSIONS,
303 - 'description' => esc_html__( 'You can crop the original image size to any custom size. You can also set a single value for height or width in order to keep the original size ratio.', 'elementor' ),
278 + 'description' => __( 'You can crop the original image size to any custom size. You can also set a single value for height or width in order to keep the original size ratio.', 'elementor' ),
304 279 'condition' => [
305 280 'size' => 'custom',
306 281 ],
282 + 'separator' => 'none',
307 283 ];
308 284
309 285 return $fields;
310 286 }
@@ -376,12 +352,12 @@
376 352
377 353 $image_sizes[ $size_key ] = $control_title;
378 354 }
379 355
380 - $image_sizes['full'] = esc_html__( 'Full', 'elementor' );
356 + $image_sizes['full'] = _x( 'Full', 'Image Size Control', 'elementor' );
381 357
382 358 if ( ! empty( $args['include']['custom'] ) || ! in_array( 'custom', $args['exclude'] ) ) {
383 - $image_sizes['custom'] = esc_html__( 'Custom', 'elementor' );
359 + $image_sizes['custom'] = _x( 'Custom', 'Image Size Control', 'elementor' );
384 360 }
385 361
386 362 return $image_sizes;
387 363 }