WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API

ProductVariations::add_wp_query_filter() public WC 1.0

Add in conditional search filters for variations.

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

No Hooks.

Return

String. Nothing.

Usage

$result = ProductVariations::add_wp_query_filter( $where, $wp_query );
$where(string) (required)
Where clause used to search posts.
$wp_query(object) (required)
WP_Query object.

Code of ProductVariations::add_wp_query_filter() WC 5.3.0

<?php
public static function add_wp_query_filter( $where, $wp_query ) {
	global $wpdb;

	$search = $wp_query->get( 'search' );
	if ( $search ) {
		$like       = '%' . $wpdb->esc_like( $search ) . '%';
		$conditions = array(
			$wpdb->prepare( "{$wpdb->posts}.post_title LIKE %s", $like ), // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			$wpdb->prepare( 'attr_search_meta.meta_value LIKE %s', $like ), // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
		);

		if ( wc_product_sku_enabled() ) {
			$conditions[] = $wpdb->prepare( 'wc_product_meta_lookup.sku LIKE %s', $like );
		}

		$where .= ' AND (' . implode( ' OR ', $conditions ) . ')';
	}

	return $where;
}