PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
← All changes | includes/controls/background.php +7 -7 2.9.12.13.1 View file →
@@ -5,8 +5,9 @@
5 5 exit;
6 6 }
7 7
8 8 use ABlocks\Classes\ControlBaseAbstract;
9 +use ABlocks\Controls\Color;
9 10
10 11 class Background extends ControlBaseAbstract {
11 12 public static function get_attribute_default_value( $is_responsive = false ) {
12 13 if ( $is_responsive ) {
@@ -230,13 +231,13 @@
230 231 } else {
231 232 $css[ $property . '-size' ] = $value[ 'imgDisplaySize' . $device ];
232 233 }
233 234 }
234 - } elseif ( 'video' === $value['backgroundType'] && '' !== $value['fallbackImageUrl'] ) {
235 + } elseif ( 'video' === $value['backgroundType'] && '' !== $value['fallbackImageUrl'] && ( $value['videoSource'] == 'none' || ( $value['videoSource'] == 'selfHosted' && empty( $value['videoUrl'] ) ) || ( $value['videoSource'] == 'youtube' && empty( $value['youtubeURL'] ) ) || ( $value['videoSource'] == 'vimeo' && empty( $value['vimeoURL'] ) ) ) ) {
235 236 $css[ $property . '-image' ] = 'url("' . $value['fallbackImageUrl'] . '")';
236 237 $css[ $property . '-size' ] = 'cover';
237 238 } elseif ( 'color' === $value['backgroundType'] && $value['backgroundColor'] ) {
238 - $css[ $property ] = $value['backgroundColor'];
239 + $css[ $property ] = Color::get_css( $value['backgroundColor'] );
239 240 }//end if
240 241
241 242 if ( '' !== $value['transitionDuration'] ) {
242 243 $css['transition'] = $property . ' ' . $value['transitionDuration'] . 's ease';
@@ -294,9 +295,9 @@
294 295 }
295 296 }
296 297 // background-attachments css
297 298 if ( '' !== isset( $value[ 'imgAttachmentH' . $device ] ) ) {
298 - $css[ $property . '-attachment' ] = isset( $value[ 'imgAttachmentH' . $device ] );
299 + $css[ $property . '-attachment' ] = $value[ 'imgAttachmentH' . $device ];
299 300 }
300 301 // background-repeat css
301 302 if ( '' !== $value[ 'imgRepeatH' . $device ] ) {
302 303 $css[ $property . '-repeat' ] = $value[ 'imgRepeatH' . $device ];
@@ -308,13 +309,12 @@
308 309 } else {
309 310 $css[ $property . '-size' ] = $value[ 'imgDisplaySizeH' . $device ];
310 311 }
311 312 }
312 - } elseif ( 'video' === $value['backgroundTypeH'] && '' !== $value['fallbackImageUrlH'] ) {
313 - $css[ $property . '-image' ] = 'url("' . $value['fallbackImageUrlH'] . '")';
314 - $css[ $property . '-size' ] = 'cover';
313 + } elseif ( 'video' === $value['backgroundTypeH'] ) {
314 +
315 315 } elseif ( 'color' === $value['backgroundTypeH'] && $value['backgroundColorH'] ) {
316 - $css[ $property ] = $value['backgroundColorH'];
316 + $css[ $property ] = Color::get_css( $value['backgroundColorH'] );
317 317 }//end if
318 318
319 319 return $css;
320 320 }