-
-
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.
feat: Add Product_Attributes_Connection_Orderby_Enum with MENU_ORDER (#…
…876) * Add Product_Attributes_Connection_Orderby_Enum with MENU_ORDER * Fix description * Add namespace * Lint fix * Make minor commit * Lint fix
- Loading branch information
Showing
4 changed files
with
72 additions
and
1 deletion.
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
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
62 changes: 62 additions & 0 deletions
62
includes/type/enum/class-product-attributes-connection-orderby-enum.php
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,62 @@ | ||
<?php | ||
/** | ||
* WPEnum Type - Product_Attributes_Connection_Orderby_Enum | ||
* | ||
* @package WPGraphQL\WooCommerce\Type\WPEnum | ||
* @since 0.2.2 | ||
*/ | ||
|
||
namespace WPGraphQL\WooCommerce\Type\WPEnum; | ||
|
||
/** | ||
* Class Product_Attributes_Connection_Orderby_Enum | ||
*/ | ||
class Product_Attributes_Connection_Orderby_Enum { | ||
/** | ||
* Registers type | ||
* | ||
* @return void | ||
*/ | ||
public static function register() { | ||
register_graphql_enum_type( | ||
'ProductAttributesConnectionOrderbyEnum', | ||
[ | ||
'description' => __( 'Product attributes connection orderby enum', 'wp-graphql-woocommerce' ), | ||
'values' => [ | ||
'NAME' => [ | ||
'value' => 'name', | ||
'description' => __( 'Order the connection by name.', 'wp-graphql-woocommerce' ), | ||
], | ||
'SLUG' => [ | ||
'value' => 'slug', | ||
'description' => __( 'Order the connection by slug.', 'wp-graphql-woocommerce' ), | ||
], | ||
'TERM_GROUP' => [ | ||
'value' => 'term_group', | ||
'description' => __( 'Order the connection by term group.', 'wp-graphql-woocommerce' ), | ||
], | ||
'TERM_ID' => [ | ||
'value' => 'term_id', | ||
'description' => __( 'Order the connection by term id.', 'wp-graphql-woocommerce' ), | ||
], | ||
'TERM_ORDER' => [ | ||
'value' => 'term_order', | ||
'description' => __( 'Order the connection by term order.', 'wp-graphql-woocommerce' ), | ||
], | ||
'MENU_ORDER' => [ | ||
'value' => 'menu_order', | ||
'description' => __( 'Order the connection by woocommerce menu order.', 'wp-graphql-woocommerce' ), | ||
], | ||
'DESCRIPTION' => [ | ||
'value' => 'description', | ||
'description' => __( 'Order the connection by description.', 'wp-graphql-woocommerce' ), | ||
], | ||
'COUNT' => [ | ||
'value' => 'count', | ||
'description' => __( 'Order the connection by item count.', 'wp-graphql-woocommerce' ), | ||
], | ||
], | ||
] | ||
); | ||
} | ||
} |