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/box-shadow.php +17 -3 2.9.02.13.1 View file →
@@ -54,14 +54,20 @@
54 54 if ( ! empty( $value['preset'] ) ) {
55 55 $css['box-shadow'] = $value['horizontal'] . 'px ' . $value['vertical'] . 'px ' . $value['blur'] . 'px ' . $value['spread'] . 'px ' . $color;
56 56 }
57 57 } else {
58 - if ( ! empty( $value['horizontal'] ) && ! empty( $value['vertical'] ) ) {
58 + // A 0 offset is a valid shadow (e.g. a centered glow); only an unset
59 + // value skips it, matching the editor's '' / undefined check.
60 + if ( self::is_offset_set( $value['horizontal'] ) && self::is_offset_set( $value['vertical'] ) ) {
59 61 $css['box-shadow'] = $value['horizontal'] . 'px ' . $value['vertical'] . 'px ' . $value['blur'] . 'px ' . $value['spread'] . 'px ' . $color;
60 62 }
61 63 }
62 64 if ( $value['transitionDuration'] ) {
63 - $css['transition'] = $property . ' ' . $value['transitionDuration'] . 's';
65 + // This control animates the box-shadow, so the transition property is
66 + // always "box-shadow". Previously it used $property, which callers
67 + // pass inconsistently (often the device string), producing invalid
68 + // CSS like "transition:Tablet 0.3s".
69 + $css['transition'] = 'box-shadow ' . $value['transitionDuration'] . 's';
64 70 }
65 71 return $css;
66 72 }
67 73
@@ -81,12 +87,20 @@
81 87 if ( ! empty( $value['presetH'] ) ) {
82 88 $css['box-shadow'] = $value['horizontalH'] . 'px ' . $value['verticalH'] . 'px ' . $value['blurH'] . 'px ' . $value['spreadH'] . 'px ' . $colorH;
83 89 }
84 90 } else {
85 - if ( ! empty( $value['horizontalH'] ) && ! empty( $value['verticalH'] ) ) {
91 + if ( self::is_offset_set( $value['horizontalH'] ) && self::is_offset_set( $value['verticalH'] ) ) {
86 92 $css['box-shadow'] = $value['horizontalH'] . 'px ' . $value['verticalH'] . 'px ' . $value['blurH'] . 'px ' . $value['spreadH'] . 'px ' . $colorH;
87 93 }
88 94 }
89 95 return $css;
96 + }
97 +
98 + /**
99 + * Whether a shadow offset is set. 0 / "0" count as set; only null and ''
100 + * mean "not configured".
101 + */
102 + private static function is_offset_set( $value ) {
103 + return null !== $value && '' !== $value;
90 104 }
91 105
92 106 }