PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 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 All 81 releases
← All changes | includes/controls/box-shadow.php +12 -2 2.11.1 → 2.14.0 View file →
@@ -54,9 +54,11 @@
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'] ) {
@@ -85,12 +87,20 @@
85 87 if ( ! empty( $value['presetH'] ) ) {
86 88 $css['box-shadow'] = $value['horizontalH'] . 'px ' . $value['verticalH'] . 'px ' . $value['blurH'] . 'px ' . $value['spreadH'] . 'px ' . $colorH;
87 89 }
88 90 } else {
89 - if ( ! empty( $value['horizontalH'] ) && ! empty( $value['verticalH'] ) ) {
91 + if ( self::is_offset_set( $value['horizontalH'] ) && self::is_offset_set( $value['verticalH'] ) ) {
90 92 $css['box-shadow'] = $value['horizontalH'] . 'px ' . $value['verticalH'] . 'px ' . $value['blurH'] . 'px ' . $value['spreadH'] . 'px ' . $colorH;
91 93 }
92 94 }
93 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;
94 104 }
95 105
96 106 }