WC_REST_Variations_Controller::prepare_objects_query
Prepare objects query.
Method of the class: WC_REST_Variations_Controller{}
No Hooks.
Returns
Array.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_objects_query( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
WC_REST_Variations_Controller::prepare_objects_query() WC REST Variations Controller::prepare objects query code WC 10.3.6
protected function prepare_objects_query( $request ) {
$args = parent::prepare_objects_query( $request );
// Retrieve variations without specifying a parent product.
if ( "/{$this->namespace}/variations" === $request->get_route() ) {
unset( $args['post_parent'] );
}
return $args;
}