Hi!
There is no option for that unfortunately, as stock status is stored in a custom field and not as a post status.
Luckily there is a way to filter them anyways. I’ve quickly put together a filtering function, which parses through the results, and checks the post status. If not in stock, the product is removed from the results list. Put this code to your themes functions.php file:
add_filter( 'asl_pagepost_results', 'asl_stock_status_filter', 1, 1 );
function asl_stock_status_filter( $pageposts ) {
$new_results = array();
foreach ($pageposts as $k=>$v) {
// Get the stock status
$stock_status = get_post_meta( $v->id, '_stock_status', true);
// No stock status? Probably a post or page, so append it and continue.
if ( $stock_status == "" ) {
$new_results[] = $v;
continue;
}
// In stock? Append of course.
if ( $stock_status == "instock" )
$new_results[] = $v;
}
return $new_results;
}
Let me know if it works. This should be update proof as well.