-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two new fields added to the "ProductCategory" type.
- Loading branch information
Showing
5 changed files
with
74 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* WPEnum Type - ProductCategoryDisplay | ||
* | ||
* @package WPGraphQL\WooCommerce\Type\WPEnum | ||
* @since 0.6.0 | ||
*/ | ||
|
||
namespace WPGraphQL\WooCommerce\Type\WPEnum; | ||
|
||
/** | ||
* Class Product_Category_Display | ||
*/ | ||
class Product_Category_Display { | ||
/** | ||
* Registers type | ||
*/ | ||
public static function register() { | ||
register_graphql_enum_type( | ||
'ProductCategoryDisplay', | ||
array( | ||
'description' => __( 'Product category display type enumeration', 'wp-graphql-woocommerce' ), | ||
'values' => array( | ||
'DEFAULT' => array( | ||
'value' => 'default', | ||
'description' => __( 'Display default content connected to this category.', 'wp-graphql-woocommerce' ), | ||
), | ||
'PRODUCTS' => array( | ||
'value' => 'products', | ||
'description' => __( 'Display products associated with this category.', 'wp-graphql-woocommerce' ), | ||
), | ||
'SUBCATEGORIES' => array( | ||
'value' => 'subcategories', | ||
'description' => __( 'Display subcategories of this category.', 'wp-graphql-woocommerce' ), | ||
), | ||
'BOTH' => array( | ||
'value' => 'both', | ||
'description' => __( 'Display both products and subcategories of this category.', 'wp-graphql-woocommerce' ), | ||
), | ||
), | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters