Posted By

javifr on 10/29/10


Tagged

wordpress taxonomy


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vehler


Get Taxonomy Terms function


 / Published in: PHP
 

  1. function get_taxonomy_terms($taxonomy,$parent = 0){
  2.  
  3. //Si viene padre 0 estamos cogiendo solo las categorias padre
  4.  
  5. $categories = get_categories( "taxonomy=$taxonomy&pad_counts=1" );
  6.  
  7. foreach($categories as $id => $category){
  8. if($category->parent <> $parent) unset($categories[$id]);
  9. }
  10.  
  11. return $categories;
  12.  
  13. }
  14.  

Report this snippet  

You need to login to post a comment.