开发者

Loading Taxonomy image field in D7

开发者 https://www.devze.com 2023-03-22 15:33 出处:网络
I created an image field in a vocabulary called field_category_image. 开发者_运维技巧 It does not show up when I load the tree.

I created an image field in a vocabulary called field_category_image. 开发者_运维技巧 It does not show up when I load the tree.

After a little digging, I came across field_get_items(), hoping this would work. It does not though. This is what I tried:

$category_image = field_get_items('taxonomy_term', $term, 'field_category_image');

PHP Fatal error:  Cannot access empty property in /var/www/demo/public_html/modules/field/field.multilingual.inc on line 275

How do I get the value of the image field I added to my vocabulary?


If loading the vocabulary terms as using taxonomy_get_tree function, remember to set the $load_entities parameter to true.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号