API: Add missing schema and output to visible field in products rest api

This commit is contained in:
Daniel Hüsken 2016-07-14 08:41:02 +02:00
parent 6faeb89dd5
commit 602bd1f0cc
1 changed files with 6 additions and 0 deletions

View File

@ -552,6 +552,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'date_on_sale_to' => $variation->sale_price_dates_to ? date( 'Y-m-d', $variation->sale_price_dates_to ) : '',
'on_sale' => $variation->is_on_sale(),
'purchasable' => $variation->is_purchasable(),
'visible' => $variation->is_visible(),
'virtual' => $variation->is_virtual(),
'downloadable' => $variation->is_downloadable(),
'downloads' => $this->get_downloads( $variation ),
@ -2392,6 +2393,11 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'visible' => array(
'description' => __( 'If the variation is visible.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' )
),
'virtual' => array(
'description' => __( 'If the variation is virtual.', 'woocommerce' ),
'type' => 'boolean',