WordPress at a glance
function is not described

WC_REST_Controller::add_meta_query() protected WC 3.0.0

Add meta query.

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_meta_query( $args, $meta_query );
$args(array) (required)
Query args.
$meta_query(array) (required)
Meta query.

Changelog

Since 3.0.0 Introduced.

Code of WC_REST_Controller::add_meta_query() WC 5.2.2

<?php
protected function add_meta_query( $args, $meta_query ) {
	if ( empty( $args['meta_query'] ) ) {
		$args['meta_query'] = array();
	}

	$args['meta_query'][] = $meta_query;

	return $args['meta_query'];
}