PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.8
Elementor Website Builder – more than just a page builder v3.25.8
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/elements/container.php +37 -188 4.2.03.25.8 View file →
@@ -38,9 +38,9 @@
38 38 * @param array|null $args
39 39 *
40 40 * @return void
41 41 */
42 - public function __construct( array $data = [], ?array $args = null ) {
42 + public function __construct( array $data = [], array $args = null ) {
43 43 parent::__construct( $data, $args );
44 44
45 45 $this->active_kit = Plugin::$instance->kits_manager->get_active_kit();
46 46 }
@@ -139,9 +139,8 @@
139 139 $config['controls'] = $this->get_controls();
140 140 $config['tabs_controls'] = $this->get_tabs_controls();
141 141 $config['show_in_panel'] = true;
142 142 $config['categories'] = [ 'layout' ];
143 - $config['include_in_widgets_config'] = true;
144 143
145 144 return $config;
146 145 }
147 146
@@ -162,14 +161,9 @@
162 161 if ( ! settings.background_play_once ) {
163 162 videoAttributes += ' loop';
164 163 }
165 164
166 - view.addRenderAttribute(
167 - 'background-video-container',
168 - {
169 - 'class': 'elementor-background-video-container',
170 - }
171 - );
165 + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-background-video-container' );
172 166
173 167 if ( ! settings.background_play_on_mobile ) {
174 168 view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
175 169 }
@@ -174,14 +168,14 @@
174 168 view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
175 169 }
176 170 #>
177 171 <div {{{ view.getRenderAttributeString( 'background-video-container' ) }}}>
178 - <div class="elementor-background-video-embed" role="presentation"></div>
179 - <video class="elementor-background-video-hosted" role="presentation" {{ videoAttributes }}></video>
172 + <div class="elementor-background-video-embed"></div>
173 + <video class="elementor-background-video-hosted elementor-html5-video" {{ videoAttributes }}></video>
180 174 </div>
181 175 <# } #>
182 - <div class="elementor-shape elementor-shape-top" aria-hidden="true"></div>
183 - <div class="elementor-shape elementor-shape-bottom" aria-hidden="true"></div>
176 + <div class="elementor-shape elementor-shape-top"></div>
177 + <div class="elementor-shape elementor-shape-bottom"></div>
184 178 <# if ( 'boxed' === settings.content_width ) { #>
185 179 </div>
186 180 <# } #>
187 181 <?php
@@ -202,16 +196,11 @@
202 196 if ( ! $settings['background_video_link'] ) {
203 197 return;
204 198 }
205 199
206 - $is_embed_video = Embed::is_embed_video( $settings['background_video_link'] );
200 + $video_properties = Embed::get_video_properties( $settings['background_video_link'] );
207 201
208 - $this->add_render_attribute(
209 - 'background-video-container',
210 - [
211 - 'class' => 'elementor-background-video-container',
212 - ]
213 - );
202 + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-background-video-container' );
214 203
215 204 if ( ! $settings['background_play_on_mobile'] ) {
216 205 $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
217 206 }
@@ -216,10 +205,10 @@
216 205 $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
217 206 }
218 207
219 208 ?><div <?php $this->print_render_attribute_string( 'background-video-container' ); ?>>
220 - <?php if ( $is_embed_video ) : ?>
221 - <div class="elementor-background-video-embed" role="presentation"></div>
209 + <?php if ( $video_properties ) : ?>
210 + <div class="elementor-background-video-embed"></div>
222 211 <?php
223 212 else :
224 213 $video_tag_attributes = 'autoplay muted playsinline';
225 214
@@ -226,9 +215,9 @@
226 215 if ( 'yes' !== $settings['background_play_once'] ) {
227 216 $video_tag_attributes .= ' loop';
228 217 }
229 218 ?>
230 - <video class="elementor-background-video-hosted" role="presentation" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
219 + <video class="elementor-background-video-hosted elementor-html5-video" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
231 220 <?php endif; ?>
232 221 </div><?php
233 222 }
234 223
@@ -251,9 +240,9 @@
251 240 if ( ! is_file( $shape_path ) || ! is_readable( $shape_path ) ) {
252 241 return;
253 242 }
254 243 ?>
255 - <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" aria-hidden="true" data-negative="<?php
244 + <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" data-negative="<?php
256 245 Utils::print_unescaped_internal_string( $negative ? 'true' : 'false' );
257 246 ?>">
258 247 <?php
259 248 // PHPCS - The file content is being read from a strict file path structure.
@@ -333,18 +322,12 @@
333 322 *
334 323 * @return \Elementor\Element_Base|\Elementor\Widget_Base|null
335 324 */
336 325 protected function _get_default_child_type( array $element_data ) {
337 - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() );
338 -
339 - if ( in_array( $element_data['elType'], $el_types, true ) ) {
340 - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] );
326 + if ( 'container' === $element_data['elType'] ) {
327 + return Plugin::$instance->elements_manager->get_element_types( 'container' );
341 328 }
342 329
343 - if ( ! isset( $element_data['widgetType'] ) ) {
344 - return null;
345 - }
346 -
347 330 return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
348 331 }
349 332
350 333 /**
@@ -492,9 +475,8 @@
492 475 'max' => 1440,
493 476 ],
494 477 ],
495 478 'description' => sprintf(
496 - /* translators: %s: 100vh. */
497 479 esc_html__( 'To achieve full height Container use %s.', 'elementor' ),
498 480 '100vh'
499 481 ),
500 482 'selectors' => [
@@ -692,22 +674,8 @@
692 674 ],
693 675 ],
694 676 ],
695 677 ],
696 - 'scripts' => [
697 - [
698 - 'name' => 'swiper',
699 - 'conditions' => [
700 - 'terms' => [
701 - [
702 - 'name' => 'background_background',
703 - 'operator' => '===',
704 - 'value' => 'slideshow',
705 - ],
706 - ],
707 - ],
708 - ],
709 - ],
710 678 ],
711 679 ]
712 680 );
713 681
@@ -747,11 +715,8 @@
747 715 ],
748 716 ],
749 717 'render_type' => 'ui',
750 718 'separator' => 'before',
751 - 'condition' => [
752 - 'background_hover_background' => [ 'classic', 'gradient' ],
753 - ],
754 719 'selectors' => [
755 720 '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;',
756 721 ],
757 722 ]
@@ -944,8 +909,16 @@
944 909 ],
945 910 ]
946 911 );
947 912
913 + $this->add_group_control(
914 + Group_Control_Css_Filter::get_type(),
915 + [
916 + 'name' => 'css_filters_hover',
917 + 'selector' => '{{WRAPPER}}:hover::before',
918 + ]
919 + );
920 +
948 921 $this->add_control(
949 922 'background_overlay_hover_transition',
950 923 [
951 924 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
@@ -958,11 +931,8 @@
958 931 ],
959 932 ],
960 933 'render_type' => 'ui',
961 934 'separator' => 'before',
962 - 'condition' => [
963 - 'background_overlay_hover_background' => [ 'classic', 'gradient' ],
964 - ],
965 935 'selectors' => [
966 936 '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;',
967 937 ],
968 938 ]
@@ -967,16 +937,8 @@
967 937 ],
968 938 ]
969 939 );
970 940
971 - $this->add_group_control(
972 - Group_Control_Css_Filter::get_type(),
973 - [
974 - 'name' => 'css_filters_hover',
975 - 'selector' => '{{WRAPPER}}:hover::before',
976 - ]
977 - );
978 -
979 941 $this->end_controls_tab();
980 942
981 943 $this->end_controls_tabs();
982 944
@@ -1124,32 +1086,17 @@
1124 1086 'conditions' => [
1125 1087 'relation' => 'or',
1126 1088 'terms' => [
1127 1089 [
1128 - 'name' => 'border_hover_border',
1090 + 'name' => 'background_background',
1129 1091 'operator' => '!==',
1130 1092 'value' => '',
1131 1093 ],
1132 1094 [
1133 - 'name' => 'border_radius_hover[top]',
1095 + 'name' => 'border_border',
1134 1096 'operator' => '!==',
1135 1097 'value' => '',
1136 1098 ],
1137 - [
1138 - 'name' => 'border_radius_hover[right]',
1139 - 'operator' => '!==',
1140 - 'value' => '',
1141 - ],
1142 - [
1143 - 'name' => 'border_radius_hover[bottom]',
1144 - 'operator' => '!==',
1145 - 'value' => '',
1146 - ],
1147 - [
1148 - 'name' => 'border_radius_hover[left]',
1149 - 'operator' => '!==',
1150 - 'value' => '',
1151 - ],
1152 1099 ],
1153 1100 ],
1154 1101 'selectors' => [
1155 1102 '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;',
@@ -1180,8 +1127,16 @@
1180 1127 );
1181 1128
1182 1129 $this->start_controls_tabs( 'tabs_shape_dividers' );
1183 1130
1131 + $shapes_options = [
1132 + '' => esc_html__( 'None', 'elementor' ),
1133 + ];
1134 +
1135 + foreach ( Shapes::get_shapes() as $shape_name => $shape_props ) {
1136 + $shapes_options[ $shape_name ] = $shape_props['title'];
1137 + }
1138 +
1184 1139 foreach ( [
1185 1140 'top' => esc_html__( 'Top', 'elementor' ),
1186 1141 'bottom' => esc_html__( 'Bottom', 'elementor' ),
1187 1142 ] as $side => $side_label ) {
@@ -1197,12 +1152,10 @@
1197 1152 $this->add_control(
1198 1153 $base_control_key,
1199 1154 [
1200 1155 'label' => esc_html__( 'Type', 'elementor' ),
1201 - 'type' => Controls_Manager::VISUAL_CHOICE,
1202 - 'label_block' => true,
1203 - 'columns' => 2,
1204 - 'options' => Shapes::get_shapes(),
1156 + 'type' => Controls_Manager::SELECT,
1157 + 'options' => $shapes_options,
1205 1158 'render_type' => 'none',
1206 1159 'frontend_available' => true,
1207 1160 'assets' => [
1208 1161 'styles' => [
@@ -1397,106 +1350,8 @@
1397 1350 ],
1398 1351 ]
1399 1352 );
1400 1353
1401 - $this->add_control(
1402 - 'heading_grid_item',
1403 - [
1404 - 'type' => Controls_Manager::HEADING,
1405 - 'label' => esc_html__( 'Grid Item', 'elementor' ),
1406 - 'separator' => 'before',
1407 - ]
1408 - );
1409 -
1410 - $this->add_responsive_control(
1411 - 'grid_column',
1412 - [
1413 - 'label' => esc_html__( 'Column Span', 'elementor' ),
1414 - 'type' => Controls_Manager::SELECT,
1415 - 'options' => [
1416 - '' => ' ' . esc_html__( 'Default', 'elementor' ),
1417 - '1' => '1',
1418 - '2' => '2',
1419 - '3' => '3',
1420 - '4' => '4',
1421 - '5' => '5',
1422 - '6' => '6',
1423 - '7' => '7',
1424 - '8' => '8',
1425 - '9' => '9',
1426 - '10' => '10',
1427 - '11' => '11',
1428 - '12' => '12',
1429 - 'custom' => esc_html__( 'Custom', 'elementor' ),
1430 - ],
1431 - 'selectors' => [
1432 - '{{WRAPPER}}' => 'grid-column: span {{VALUE}};',
1433 - ],
1434 - ]
1435 - );
1436 -
1437 - $this->add_responsive_control(
1438 - 'grid_column_custom',
1439 - [
1440 - 'label' => esc_html__( 'Custom', 'elementor' ),
1441 - 'type' => Controls_Manager::TEXT,
1442 - 'ai' => [
1443 - 'active' => false,
1444 - ],
1445 - 'selectors' => [
1446 - '{{WRAPPER}}' => 'grid-column: {{VALUE}}',
1447 - ],
1448 - 'condition' => [
1449 - 'grid_column' => 'custom',
1450 - ],
1451 - ]
1452 - );
1453 -
1454 - $this->add_responsive_control(
1455 - 'grid_row',
1456 - [
1457 - 'label' => esc_html__( 'Row Span', 'elementor' ),
1458 - 'type' => Controls_Manager::SELECT,
1459 - 'options' => [
1460 - '' => ' ' . esc_html__( 'Default', 'elementor' ),
1461 - '1' => '1',
1462 - '2' => '2',
1463 - '3' => '3',
1464 - '4' => '4',
1465 - '5' => '5',
1466 - '6' => '6',
1467 - '7' => '7',
1468 - '8' => '8',
1469 - '9' => '9',
1470 - '10' => '10',
1471 - '11' => '11',
1472 - '12' => '12',
1473 - 'custom' => esc_html__( 'Custom', 'elementor' ),
1474 - ],
1475 - 'selectors' => [
1476 - '{{WRAPPER}}' => 'grid-row: span {{VALUE}};',
1477 - ],
1478 - ]
1479 - );
1480 -
1481 - $this->add_responsive_control(
1482 - 'grid_row_custom',
1483 - [
1484 - 'label' => esc_html__( 'Custom', 'elementor' ),
1485 - 'type' => Controls_Manager::TEXT,
1486 - 'separator' => 'after',
1487 - 'ai' => [
1488 - 'active' => false,
1489 - ],
1490 - 'selectors' => [
1491 - '{{WRAPPER}}' => 'grid-row: {{VALUE}}',
1492 - ],
1493 - 'condition' => [
1494 - 'grid_row' => 'custom',
1495 - ],
1496 - ]
1497 - );
1498 -
1499 1354 $this->add_group_control(
1500 1355 Group_Control_Flex_Item::get_type(),
1501 1356 [
1502 1357 'name' => '_flex',
@@ -1961,11 +1816,11 @@
1961 1816 return self::slider_to_gaps_converter( $element );
1962 1817 }
1963 1818
1964 1819 /**
1965 - * Convert slider to gaps control for the 3.16 upgrade script
1820 + * convert slider to gaps control for the 3.16 upgrade script
1966 1821 *
1967 - * @param array $element
1822 + * @param $element
1968 1823 * @return array
1969 1824 */
1970 1825 public static function slider_to_gaps_converter( $element ) {
1971 1826 $breakpoints = array_keys( (array) Plugin::$instance->breakpoints->get_breakpoints() );
@@ -1976,15 +1831,9 @@
1976 1831 $control = 'desktop' !== $breakpoint
1977 1832 ? $control_name . '_' . $breakpoint
1978 1833 : $control_name;
1979 1834
1980 - if ( ! isset( $element['settings'][ $control ] ) ) {
1981 - continue;
1982 - }
1983 -
1984 - $already_using_gaps_control = isset( $element['settings'][ $control ]['isLinked'] ); // Slider control won't have the 'isLinked' property.
1985 -
1986 - if ( ! $already_using_gaps_control ) {
1835 + if ( isset( $element['settings'][ $control ] ) ) {
1987 1836 $old_size = strval( $element['settings'][ $control ]['size'] );
1988 1837
1989 1838 $element['settings'][ $control ]['column'] = $old_size;
1990 1839 $element['settings'][ $control ]['row'] = $old_size;