WordPress at Your Fingertips
function is not described

WC_REST_Legacy_Coupons_Controller::query_args() public WC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Query args.

{} It's a method of the class: WC_REST_Legacy_Coupons_Controller{}

No Hooks.

Return

Array.

Usage

$WC_REST_Legacy_Coupons_Controller = new WC_REST_Legacy_Coupons_Controller();
$WC_REST_Legacy_Coupons_Controller->query_args( $args, $request );
$args(array) (required)
Query args
$request(WP_REST_Request) (required)
Request data.

Changelog

Deprecated 3.0.0

Code of WC_REST_Legacy_Coupons_Controller::query_args() WC 5.7.0

public function query_args( $args, $request ) {
	if ( ! empty( $request['code'] ) ) {
		$id = wc_get_coupon_id_by_code( $request['code'] );
		$args['post__in'] = array( $id );
	}

	return $args;
}