WC_REST_Order_Refunds_Controller::get_public_preview_schema
Get the public schema for the refund preview endpoint.
Method of the class: WC_REST_Order_Refunds_Controller{}
No Hooks.
Returns
array.
Usage
$WC_REST_Order_Refunds_Controller = new WC_REST_Order_Refunds_Controller(); $WC_REST_Order_Refunds_Controller->get_public_preview_schema();
Changelog
| Since 11.1.0 | Introduced. |
WC_REST_Order_Refunds_Controller::get_public_preview_schema() WC REST Order Refunds Controller::get public preview schema code WC 11.1.2
public function get_public_preview_schema() {
$schema = wc_get_container()->get( RefundPreviewSchema::class )->get_item_schema();
$schema['title'] = 'order_refund_preview';
// Like the sibling v3 schema getters: fields registered via
// register_rest_field() must appear in the published schema.
return $this->add_additional_fields_schema( $schema );
}