[REST API] Include variation description, closes #11815

This commit is contained in:
Claudio Sanches 2016-09-13 19:28:25 -03:00
parent 2e26752e47
commit 16eb18a0ab
1 changed files with 6 additions and 0 deletions

View File

@ -560,6 +560,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'date_created' => wc_rest_prepare_date_response( $post_data->post_date_gmt ),
'date_modified' => wc_rest_prepare_date_response( $post_data->post_modified_gmt ),
'permalink' => $variation->get_permalink(),
'description' => $variation->get_variation_description(),
'sku' => $variation->get_sku(),
'price' => $variation->get_price(),
'regular_price' => $variation->get_regular_price(),
@ -2375,6 +2376,11 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'description' => array(
'description' => __( 'Product description.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'sku' => array(
'description' => __( 'Unique identifier.', 'woocommerce' ),
'type' => 'string',