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.
精彩评论