Correct way to access field values? field_view_value after field_get_items? So I want to get some field values that I need as input, sometimes for rendering.  According to this page:

http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way

It is a mistake to hard-code 'und' for internationalization, so to avoid this the author says that we should use field_view_field().  

I personally, don't need all info related to the field, just the value.  So I opt for field_get_items() and then field_view_value() as outlined in the blog post.  But this seems a lot of work just to get a single value of a field (plus we have to find and load the node).  Do we really have to do so many steps to get a simple field value?  I would have thought that this would be a very common function that users need.  

I'm wondering that, barring any simple method, I could just grab the value directly from field_get_items()[0]['value'].  Maybe the drawbacks are that it doesn't pass through any sanitation routines?   You can see more info here (trying to grab 'axis1t'):



Just looking for possible alternatives because my code is becoming somewhat bloated to keep getting field values this way along with the fact that they are burried inside field_collections.
If you are worried about bloat, just write your own field processor and keep it all on the level. That way you are using safe values, your site won't trip over if the language settings wiggle about and you can reuse your code in your next site.

You would call it wherever you like and because you know what you're expecting to get back, you could work with it immediately.

Something like:

&lt;?php 
/* get the values out of a field */
function magic_field_values($node, $field_name, $delta = null){
  $field_items = field_get_items('node', $node, $field_name);
  /* if a delta value is supplied, render that item otherwise, send the lot
  back. */ 
  if ($delta){
    return field_view_value('node', $node, $field_name, $field_items[$delta]);
  } else
  return $field_items;
}
?&gt;


Then call it with:

&lt;?php 
$cheese_samples = magic_field_values($node, 'field_cheese_samples');
foreach $cheese_samples as $sample {
//do stuff
}
?&gt;