Advertisement
Guest User

Untitled

a guest
Sep 20th, 2011
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None
  1. These are the categories, the x marks the categories a random post has selected.
  2. =============
  3. [ ] Movies
  4. -- [ x ] Comedy
  5. -- [ x ] Thriller
  6. -- -- [ x ] Noir
  7.  
  8. [] Music
  9. -- [] Dance
  10. ============
  11.  
  12. When I run
  13. wp_get_object_terms($post->ID, 'project_category', array('orderby' => 'term_order'));
  14.  
  15. The result is below. As you can see the Thriller is first instead of the expect Comedy.
  16.  
  17. Array
  18. (
  19. [0] => stdClass Object
  20. (
  21. [term_id] => 32
  22. [name] => Thriller
  23. [slug] => thriller
  24. [term_group] => 0
  25. [term_taxonomy_id] => 35
  26. [taxonomy] => project_category
  27. [description] =>
  28. [parent] => 31
  29. [count] => 1
  30. )
  31.  
  32. [1] => stdClass Object
  33. (
  34. [term_id] => 33
  35. [name] => Noir
  36. [slug] => noir
  37. [term_group] => 0
  38. [term_taxonomy_id] => 36
  39. [taxonomy] => project_category
  40. [description] =>
  41. [parent] => 32
  42. [count] => 2
  43. )
  44.  
  45. [2] => stdClass Object
  46. (
  47. [term_id] => 34
  48. [name] => Comedy
  49. [slug] => comedy
  50. [term_group] => 0
  51. [term_taxonomy_id] => 37
  52. [taxonomy] => project_category
  53. [description] =>
  54. [parent] => 31
  55. [count] => 1
  56. )
  57.  
  58. )
Advertisement
RAW Paste Data Copied
Advertisement