title: Woocommerce hide empty filters in shop after woocommerce_product_query
body: <p>I am using <code>woocommerce_product_query</code> in order to limit the products per logged in user (a user can only see his products).
  But in shop page filters are populates with empty filters and categories too. How I can load only filters with content?</p>
  <p>For example user1 can only see product A (green tshirt) and user 2 can only see product B (red shoe). So after <code>woocommerce_product_query</code> user1 should be able to see only green in color filter and tshirt in category filter and user2 should be able to see only red in color filter and shoe in category filter and so on.</p>
  <p>So is it possible to 'populate' the filters after woocommerce_product_query?</p>
  <p>here is my code:</p>
  <pre><code>add_action( 'woocommerce_product_query', 'al_pre_get_posts_query', 900 );
  function al_pre_get_posts_query( $query ) {
      
      $meta_query = $query-&gt;get( 'meta_query' );
      $meta_query[] = array(
          'key' =&gt; '_thumbnail_id',
         'value' =&gt; '0',
         'compare' =&gt; '&gt;'
      );
      $meta_query[] = array(
          'key'       =&gt; '_stock_status',
          'compare'   =&gt; '=',
          'value'     =&gt; 'instock'
      );
      $query-&gt;set( 'meta_query', $meta_query );
      
      global $wpdb;
      global $current_user;
      wp_get_current_user();
      $assortment = get_user_meta($current_user-&gt;ID, 'assortment', 'true');
      $user_id = get_current_user_id();
      if( $assortment == 'true' ){ 
          $customer_id = get_user_meta( $user_id, 'customer_id', true ); 
          $products = $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT product_id FROM &quot;.$wpdb-&gt;prefix.&quot;assortments WHERE customer_id = %s&quot;,$customer_id ) );
          if(empty($products)){
              return;
          }
          else{ 
              $query-&gt;set( 'post__in', $products );
          }
      }
      else{ 
  
          $query-&gt;set( 'post__in', $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT ID FROM {$wpdb-&gt;prefix}posts WHERE post_type IN ('product','product_variation')&quot;)) );
      }
  
  }
  </code></pre>