Only Include In-Stock WooCommerce Products in Grid

The following code can be used to modify the grid's items to only include products listed as "In Stock".
Only Applicable for WooCommerce Product Grids.

1. Get your grid's ID.

2. Add the following code to your theme's "functions.php" file, modifying the number "1" with your grid's ID.