Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- These are the categories, the x marks the categories a random post has selected.
- =============
- [ ] Movies
- -- [ x ] Comedy
- -- [ x ] Thriller
- -- -- [ x ] Noir
- [] Music
- -- [] Dance
- ============
- When I run
- wp_get_object_terms($post->ID, 'project_category', array('orderby' => 'term_order'));
- The result is below. As you can see the Thriller is first instead of the expect Comedy.
- Array
- (
- [0] => stdClass Object
- (
- [term_id] => 32
- [name] => Thriller
- [slug] => thriller
- [term_group] => 0
- [term_taxonomy_id] => 35
- [taxonomy] => project_category
- [description] =>
- [parent] => 31
- [count] => 1
- )
- [1] => stdClass Object
- (
- [term_id] => 33
- [name] => Noir
- [slug] => noir
- [term_group] => 0
- [term_taxonomy_id] => 36
- [taxonomy] => project_category
- [description] =>
- [parent] => 32
- [count] => 2
- )
- [2] => stdClass Object
- (
- [term_id] => 34
- [name] => Comedy
- [slug] => comedy
- [term_group] => 0
- [term_taxonomy_id] => 37
- [taxonomy] => project_category
- [description] =>
- [parent] => 31
- [count] => 1
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement