Skip to main content
wrong variable, womp womp
Source Link
beth
  • 9.1k
  • 3
  • 37
  • 86

It appears from your printout that taxonomy_term is an object, not an array. So your code would look like this:

$country = $node->field_location_term['und'][0]>field_location_term['und'][0]['taxonomy_term']->taxonomy_term['name'];>name;

You might not be able to do the object->['array']->object->['key'] thing. It might need to be broken into:

$foo = $node->field_location_term['und'][0]>field_location_term['und'][0]['taxonomy_term'];
$country = $foo->taxonomy_term['name'];>name;

It appears from your printout that taxonomy_term is an object, not an array. So your code would look like this:

$country = $node->field_location_term['und'][0]->taxonomy_term['name'];

You might not be able to do the object->['array']->object->['key'] thing. It might need to be broken into:

$foo = $node->field_location_term['und'][0]
$country = $foo->taxonomy_term['name'];

It appears from your printout that taxonomy_term is an object, not an array. So your code would look like this:

$country = $node->field_location_term['und'][0]['taxonomy_term']->name;

You might not be able to do the object->['array']->object->['key'] thing. It might need to be broken into:

$foo = $node->field_location_term['und'][0]['taxonomy_term'];
$country = $foo->name;
Source Link
beth
  • 9.1k
  • 3
  • 37
  • 86

It appears from your printout that taxonomy_term is an object, not an array. So your code would look like this:

$country = $node->field_location_term['und'][0]->taxonomy_term['name'];

You might not be able to do the object->['array']->object->['key'] thing. It might need to be broken into:

$foo = $node->field_location_term['und'][0]
$country = $foo->taxonomy_term['name'];