0

我想term_taxonomy_id从下面的数组中获取,但每次它都会给我以下错误。

可捕获的致命错误:类 WP_Error 的对象无法在 C 中转换为字符串.....

 Array
 (
   [0] => stdClass Object
    (
        [term_id] => 5
        [name] => fonts
        [slug] => fonts
        [term_group] => 0
        [term_taxonomy_id] => 5
        [taxonomy] => category
        [description] => 
        [parent] => 0
        [count] => 2
        [object_id] => 96
        [cat_ID] => 5
        [category_count] => 2
        [category_description] => 
        [cat_name] => fonts
        [category_nicename] => fonts
        [category_parent] => 0
    )
)
4

1 回答 1

2

你试图得到什么错误?尝试这个:

foreach($yourarray as $term){
  echo $term->term_taxonomy_id;
}
于 2012-12-07T07:58:06.243 回答