From 7ea5c7501f0fa4fd318160bab616a69bdd5199a8 Mon Sep 17 00:00:00 2001 From: barryhughes <3594411+barryhughes@users.noreply.github.com> Date: Wed, 5 May 2021 11:43:14 -0700 Subject: [PATCH] Test for the presence of 3 or more args (not 2 or more). | #29124 --- .../Version2/class-wc-rest-products-v2-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php b/includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php index 2e80879f194..4927dc37f1b 100644 --- a/includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php +++ b/includes/rest-api/Controllers/Version2/class-wc-rest-products-v2-controller.php @@ -640,7 +640,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_CRUD_Controller { * * TODO: Refactor to fix this behavior when DI gets included to make it obvious and clean. */ - $request = func_num_args() >= 2 ? func_get_arg( 2 ) : new WP_REST_Request( '', '', array( 'context' => $context ) ); + $request = func_num_args() >= 3 ? func_get_arg( 2 ) : new WP_REST_Request( '', '', array( 'context' => $context ) ); $fields = $this->get_fields_for_response( $request ); $base_data = array();