title: get the category names only, with get_terms
body: <pre><code>&lt;?php  
    $categories = array('bathroom', 'bar');  
  
      foreach ($categories as $category) {
          $args = array( 'post_type' =&gt; 'product', 'posts_per_page' =&gt; 3, 'product_cat' =&gt; $category, 'orderby' =&gt; 'rand' );
  ?&gt;
  </code></pre>
  
  <p>I want to make the function above a little more dynamic. In such a way that I won't have to manually add the specific categories to the $categories variable. Instead, I need something that will get only the names of the (woocommerce product) categories, and places them in an array.</p>
  
  <p>I did get the list with this:</p>
  
  <pre><code>$category_list_items = get_terms( 'product_cat' );
  
  foreach($category_list_items as $category_list_item){
      echo $category_list_item-&gt;name;
  }
  </code></pre>
  
  <p>But I don't know how to get this list into the first function. Does anyone have an idea how to do this?</p>
  
  <p>Thanks!</p>