Skip to content
Merged

Release #4554

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions inc/core/styles/dynamic_selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Dynamic_Selector {
const META_DEVICE_ONLY = 'device_only';
const META_FILTER = 'filter';
const META_AS_JSON = 'as_json';
const META_IS_EMPTY = 'is_empty';

const KEY_SELECTOR = 'selectors';
const KEY_RULES = 'rules';
Expand Down Expand Up @@ -174,6 +175,10 @@ public function get_value( $meta ) {
$default = isset( $meta[ self::META_DEFAULT ] ) ? $meta[ self::META_DEFAULT ] : false;
$value = Mods::get( $key, $default );

// Only check whether the value is empty when the meta has the is_empty flag set to true.
if ( isset( $meta[ self::META_IS_EMPTY ] ) && $meta[ self::META_IS_EMPTY ] && empty( $value ) ) {
return $default;
}

if ( $value === false || $value === null || $value === '' ) {
return $default;
Expand Down
Loading