Automattic\WooCommerce\Admin\API

ProductVariations::get_items()publicWC 1.0

Get a collection of posts and add the post title filter option to WP_Query.

Method of the class: ProductVariations{}

No Hooks.

Return

WP_Error|WP_REST_Response.

Usage

$ProductVariations = new ProductVariations();
$ProductVariations->get_items( $request );
$request(WP_REST_Request) (required)
Full details about the request.

ProductVariations::get_items() code WC 8.7.0

public function get_items( $request ) {
	add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10, 2 );
	add_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10, 2 );
	add_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10, 2 );
	$response = parent::get_items( $request );
	remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10 );
	remove_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10 );
	remove_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10 );
	return $response;
}