Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add formatted_date_created schema #788

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/RestApi/Controllers/ProductReviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,37 +252,43 @@ public function get_item_schema() {
'title' => 'product_block_review',
'type' => 'object',
'properties' => array(
'id' => array(
'id' => array(
'description' => __( 'Unique identifier for the resource.', 'woo-gutenberg-products-block' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created' => array(
'date_created' => array(
'description' => __( "The date the review was created, in the site's timezone.", 'woo-gutenberg-products-block' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created_gmt' => array(
'formatted_date_created' => array(
'description' => __( "The date the review was created, in the site's timezone in human-readable format.", 'woo-gutenberg-products-block' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'date_created_gmt' => array(
'description' => __( 'The date the review was created, as GMT.', 'woo-gutenberg-products-block' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'product_id' => array(
'product_id' => array(
'description' => __( 'Unique identifier for the product that the review belongs to.', 'woo-gutenberg-products-block' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'reviewer' => array(
'reviewer' => array(
'description' => __( 'Reviewer name.', 'woo-gutenberg-products-block' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'review' => array(
'review' => array(
'description' => __( 'The content of the review.', 'woo-gutenberg-products-block' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
Expand All @@ -291,13 +297,13 @@ public function get_item_schema() {
),
'readonly' => true,
),
'rating' => array(
'rating' => array(
'description' => __( 'Review rating (0 to 5).', 'woo-gutenberg-products-block' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'verified' => array(
'verified' => array(
'description' => __( 'Shows if the reviewer bought the product or not.', 'woo-gutenberg-products-block' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
Expand Down