Server IP : 66.29.132.122 / Your IP : 18.188.228.164 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-blocks/src/StoreApi/Schemas/ |
Upload File : |
<?php namespace Automattic\Kkart\Blocks\StoreApi\Schemas; /** * ErrorSchema class. * * @internal This API is used internally by Blocks--it is still in flux and may be subject to revisions. * @since 2.5.0 */ class ErrorSchema extends AbstractSchema { /** * The schema item name. * * @var string */ protected $title = 'error'; /** * Product schema properties. * * @return array */ public function get_properties() { return [ 'code' => [ 'description' => __( 'Error code', 'kkart' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], 'message' => [ 'description' => __( 'Error message', 'kkart' ), 'type' => 'string', 'context' => [ 'view', 'edit' ], 'readonly' => true, ], ]; } /** * Convert a Kkart product into an object suitable for the response. * * @param \WP_Error $error Error object. * @return array */ public function get_item_response( \WP_Error $error ) { return [ 'code' => $this->prepare_html_response( $error->get_error_code() ), 'message' => $this->prepare_html_response( $error->get_error_message() ), ]; } }