WC_REST_Products_Controller::add_search_criteria_to_wp_query_join()
Join wc_product_meta_lookup table when SKU search query is present.
Метод класса: WC_REST_Products_Controller{}
Хуков нет.
Возвращает
Строку
.
Использование
$WC_REST_Products_Controller = new WC_REST_Products_Controller(); $WC_REST_Products_Controller->add_search_criteria_to_wp_query_join( $join );
- $join(строка) (обязательный)
- Join clause used to search posts.
Код WC_REST_Products_Controller::add_search_criteria_to_wp_query_join() WC REST Products Controller::add search criteria to wp query join WC 9.3.3
public function add_search_criteria_to_wp_query_join( $join ) { global $wpdb; if ( ! empty( $this->search_sku_in_product_lookup_table ) && ! strstr( $join, 'wc_product_meta_lookup' ) ) { $join .= " LEFT JOIN $wpdb->wc_product_meta_lookup wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id "; } return $join; }