Hide private products from the shop in WooCommerce on child sites.
Snippet Type
Execute on Child Sites
Snippet
add_filter( 'posts_where', 'wc_no_private_products_posts_frontend_administrator' );
function wc_no_private_products_posts_frontend_administrator( $where ) {
if ( is_admin() ) return $where;
global $wpdb;
return " $where AND {$wpdb->posts}.post_status != 'private' ";
}