WC_Admin_List_Table_Products::filter_stock_status_post_clauses
Filter by stock status.
Method of the class: WC_Admin_List_Table_Products{}
No Hooks.
Returns
Array.
Usage
$WC_Admin_List_Table_Products = new WC_Admin_List_Table_Products(); $WC_Admin_List_Table_Products->filter_stock_status_post_clauses( $args );
- $args(array) (required)
- Query args.
WC_Admin_List_Table_Products::filter_stock_status_post_clauses() WC Admin List Table Products::filter stock status post clauses code WC 10.3.3
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;
}