WC_Admin_List_Table_Products::filter_stock_status_post_clauses()publicWC 1.0

Filter by stock status.

Метод класса: WC_Admin_List_Table_Products{}

Хуков нет.

Возвращает

Массив.

Использование

$WC_Admin_List_Table_Products = new WC_Admin_List_Table_Products();
$WC_Admin_List_Table_Products->filter_stock_status_post_clauses( $args );
$args(массив) (обязательный)
Query args.

Код WC_Admin_List_Table_Products::filter_stock_status_post_clauses() WC 8.7.0

public function filter_stock_status_post_clauses( $args ) {
	global $wpdb;
	if ( ! empty( $_GET['stock_status'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		$args['join']   = $this->append_product_sorting_table_join( $args['join'] );
		$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.stock_status=%s ', wc_clean( wp_unslash( $_GET['stock_status'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	}
	return $args;
}