[API] Fixed the datetime format for WC_API_Customers::get_customer_downloads()

This commit is contained in:
Claudio Sanches 2015-01-21 10:38:33 -02:00
parent de4d70d16a
commit ec6039794a
1 changed files with 5 additions and 3 deletions

View File

@ -497,10 +497,12 @@ class WC_API_Customers extends WC_API_Resource {
return $id;
}
$downloads = wc_get_customer_available_downloads( $id );
$downloads = array();
$_downloads = wc_get_customer_available_downloads( $id );
if ( empty( $downloads ) ) {
return array( 'downloads' => array() );
foreach ( $_downloads as $key => $download ) {
$downloads[ $key ] = $download;
$downloads[ $key ]['access_expires'] = $this->server->format_datetime( $downloads[ $key ]['access_expires'] );
}
return array( 'downloads' => apply_filters( 'woocommerce_api_customer_downloads_response', $downloads, $id, $fields, $this->server ) );