PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
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 1.10.1 1.10.0 1.9.17 All 166 releases
← All changes | includes/API/V2/Catalog_Proxy_Controller.php +7 -0 1.10.15 → 1.10.21 View file →
@@ -6,8 +6,9 @@
6 6 */
7 7
8 8 namespace WCPOS\WooCommercePOS\API\V2;
9 9
10 +use WCPOS\WooCommercePOS\API\V2\Proxy\Fast_Path_Behavior;
10 11 use WCPOS\WooCommercePOS\API\V2\Proxy\Null_Proxy_Behavior;
11 12 use WCPOS\WooCommercePOS\API\V2\Proxy\Proxy_Behavior;
12 13 use WCPOS\WooCommercePOS\Sync\Api;
13 14 use WCPOS\WooCommercePOS\Sync\Collections;
@@ -72,8 +73,14 @@
72 73 * client sees the same failure it would have seen hitting wc/v3 directly.
73 74 */
74 75 public function proxy( WP_REST_Request $request, string $wc_route, string $resource, ?Proxy_Behavior $behavior = null ) {
75 76 $behavior = $behavior ?? self::behavior_for( $resource );
77 + if ( $behavior instanceof Fast_Path_Behavior ) {
78 + $fast = $behavior->fast_response( $request );
79 + if ( null !== $fast ) {
80 + return $fast;
81 + }
82 + }
76 83 $query_params = $behavior->forwarded_params( $request->get_query_params(), $request );
77 84 $inner = new WP_REST_Request( WP_REST_Server::READABLE, $wc_route );
78 85 unset( $query_params[ Store_Scope::PARAM ] );
79 86 $inner->set_query_params( $query_params );