PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
← All changes | includes/API/V1/Orders_Controller.php +27 -1 1.10.5 → 1.10.17 View file →
@@ -336,9 +336,9 @@
336 336 ),
337 337 )
338 338 ),
339 339 ),
340 - 'schema' => array(),
340 + 'schema' => array( $this, 'wcpos_get_public_send_email_schema' ),
341 341 )
342 342 );
343 343
344 344 register_rest_route(
@@ -1011,8 +1011,34 @@
1011 1011 ),
1012 1012 'name' => array(
1013 1013 'description' => __( 'Display name of the order status.', 'woocommerce-pos' ),
1014 1014 'type' => 'string',
1015 + 'context' => array( 'view', 'edit' ),
1016 + 'readonly' => true,
1017 + ),
1018 + ),
1019 + );
1020 + }
1021 +
1022 + /**
1023 + * Get the route schema for the send-email action.
1024 + *
1025 + * Registered as the route-level `schema` callback. WordPress invokes it with
1026 + * `call_user_func()` whenever a namespace index is requested with
1027 + * `context=help`, so it must be a real callable — an empty array there
1028 + * passes `isset()` and then fatals with a TypeError.
1029 + *
1030 + * @return array
1031 + */
1032 + public function wcpos_get_public_send_email_schema() {
1033 + return array(
1034 + '$schema' => 'http://json-schema.org/draft-04/schema#',
1035 + 'title' => 'order_email',
1036 + 'type' => 'object',
1037 + 'properties' => array(
1038 + 'success' => array(
1039 + 'description' => __( 'Whether the order email was sent.', 'woocommerce-pos' ),
1040 + 'type' => 'boolean',
1015 1041 'context' => array( 'view', 'edit' ),
1016 1042 'readonly' => true,
1017 1043 ),
1018 1044 ),