One World Direct
5.0
SELECT
t.term_id,
t.name,
t.slug,
tt.parent,
tt.count,
tt.taxonomy
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id
INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tr.object_id = 7797
AND tt.taxonomy = 'location'
Array
(
[0] => stdClass Object
(
[term_id] => 173
[name] => Netherlands
[slug] => netherlands
[parent] => 165
[count] => 55
[taxonomy] => location
)
[1] => stdClass Object
(
[term_id] => 1132
[name] => Netherlands
[slug] => netherlands-2
[parent] => 0
[count] => 40
[taxonomy] => location
)
[2] => stdClass Object
(
[term_id] => 5812
[name] => North Holland
[slug] => north-holland
[parent] => 1132
[count] => 16
[taxonomy] => location
)
[3] => stdClass Object
(
[term_id] => 5813
[name] => Amsterdam
[slug] => amsterdam
[parent] => 5812
[count] => 11
[taxonomy] => location
)
[4] => stdClass Object
(
[term_id] => 5984
[name] => South Dakota
[slug] => south-dakota
[parent] => 194
[count] => 5
[taxonomy] => location
)
[5] => stdClass Object
(
[term_id] => 5985
[name] => Mobridge
[slug] => mobridge
[parent] => 5984
[count] => 1
[taxonomy] => location
)
)
Array
(
[0] => Amsterdam
)