title: List all taxonomies assigned from a custom post type
body: <p>I am really desperate for help here, been trying do this since yesterday and still no luck, so here is what I want to achieve</p>
  
  <p><strong>Collection</strong> = custom post type</p>
  
  <ul>
  <li><p><strong>Material</strong> = custom taxonomy assigned to "collection"</p>
  
  <ul>
  <li>Mat1 = term</li>
  <li>Mat2 = term</li>
  </ul></li>
  <li><p><strong>Body</strong> = custom taxonomy assigned to "collection"</p>
  
  <ul>
  <li>Body1 = term</li>
  <li>Body2 = term</li>
  </ul></li>
  <li><p><strong>Color</strong> = custom taxonomy assigned to "collection"</p>
  
  <ul>
  <li>Color1 = term</li>
  <li>Color2 = term</li>
  </ul></li>
  </ul>
  
  <p>The structure will be something like this</p>
  
  <pre><code>- Material
    - Mat1
    - Mat2
  - Body
    - Body1
    - Body2
  - Color
    - Color1
    - Color2
  </code></pre>
  
  <p>I got this code but it's not working at all</p>
  
  <pre><code>$post_type = 'collection';
  $taxonomies = get_object_taxonomies( (object) array( 'post_type' =&gt; $post_type, 'hide_empty' =&gt; true ) );
  
  foreach( $taxonomies as $taxonomy ){
      echo $taxonomy-&gt;name;
  
      $terms = get_terms( $taxonomy );
      foreach( $terms as $term ){
          echo '&lt;li&gt;';
          echo $term-&gt;name;
          echo '&lt;/li&gt;';
      }
  }
  </code></pre>