I declared a taxonomy metabox field like so:
// TAXONOMY - Neighborhood
array(
'name' => __( 'Neighborhood', 'meta-box' ),
'id' => "{$prefix}neighborhood",
'type' => 'taxonomy',
'columns' => 4,
'tab' => 'summary',
'options' => array(
// Taxonomy name
'taxonomy' => 'neighborhood',
// How to show taxonomy: 'checkbox_list' (default) or 'checkbox_tree', 'select_tree', select_advanced or 'select'. Optional
'type' => 'select_tree',
// Additional arguments for get_terms() function. Optional
'args' => array()
),
),
And I am accessing the named vars within it like so:
$neighborhood = rwmb_meta('sg_neighborhood', 'type=taxonomy&taxonomy=neighborhood');
foreach ($neighborhood as $term) {
$desc = $term->description;
$hood = $term->name;
$prnt = $term->parent;
}
echo $hood . ', ' . $prnt;
Which results in:
http://cl.ly/image/2B0N1i082h3E
I have my neighborhoods taxonomy set up as parent > child, but when I dump the array they show as siblings. And the result of echo $hood is always the last $term->name
Results of var_dump($neighborhoods);
array(2) {
[0]=>
object(stdClass)#2507 (10) {
["term_id"]=>
int(1237)
["name"]=>
string(8) "Belltown"
["slug"]=>
string(8) "belltown"
["term_group"]=>
int(0)
["term_taxonomy_id"]=>
int(1347)
["taxonomy"]=>
string(12) "neighborhood"
["description"]=>
string(0) ""
["parent"]=>
int(1236)
["count"]=>
int(25)
["filter"]=>
string(3) "raw"
}
[1]=>
object(stdClass)#2672 (10) {
["term_id"]=>
int(1236)
["name"]=>
string(16) "Downtown Seattle"
["slug"]=>
string(16) "downtown-seattle"
["term_group"]=>
int(0)
["term_taxonomy_id"]=>
int(1358)
["taxonomy"]=>
string(12) "neighborhood"
["description"]=>
string(0) ""
["parent"]=>
int(0)
["count"]=>
int(51)
["filter"]=>
string(3) "raw"
}
}
Here is how it looks in the editor:
And the code behind:
Thanks for any help