次の内容/構造を持つ変数「$terms」があります。
Array
(
[507] => stdClass Object
(
[term_id] => 507
[name] => Blog
[slug] => blog
[term_group] => 0
[term_taxonomy_id] => 679
[taxonomy] => blog-category
[description] =>
[parent] => 0
[count] => 3
[object_id] => 13665
)
[494] => stdClass Object
(
[term_id] => 494
[name] => ZMisc
[slug] => misc
[term_group] => 0
[term_taxonomy_id] => 662
[taxonomy] => blog-category
[description] =>
[parent] => 0
[count] => 5
[object_id] => 13665
)
)
最初のオブジェクトの名前の値を取得する必要があります。したがって、この例では、「Blog」の値を取得する必要があります。この配列は現在 $terms として保存されています。私は $terms[0]->name をこの構文の他のいくつかのバリアントの中で試しましたが、必要なものを完全に取得できません。