Test for the presence of 3 or more args (not 2 or more). | #29124

This commit is contained in:
barryhughes 2021-05-05 11:43:14 -07:00
parent 0d59195657
commit 7ea5c7501f
1 changed files with 1 additions and 1 deletions

View File

@ -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();