Skip to content

Commit 228284d

Browse files
authored
fix: ProductAttributeEnum given default value, if no product attributes exist (#814)
* fix: ProductAttributeEnum no longer registered if no attribute exist * fix: ProductAttributeEnum default value provided
1 parent 63a2727 commit 228284d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

includes/type/enum/class-product-attribute-enum.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public static function register() {
3232
}
3333
}
3434

35+
if ( empty( $taxonomy_values ) ) {
36+
$taxonomy_values['NONE'] = [ 'value' => 'none' ];
37+
}
38+
3539
register_graphql_enum_type(
3640
'ProductAttributeEnum',
3741
[

0 commit comments

Comments
 (0)