How to hook into an attachment? I have a field loading hidden in an attachment view and I need to hook into that attachment to alter the output of the field.

It involves PHP and I'd rather hook into template.php rather than download some PHP module to store PHP code in my database.

I've tried hooking into theme_views_pre_render but I can't find my attachment, I can only modify the $view->attachment_before output.

That, plus I can't actually obtain the field values in this hook?

So how can I hook into a field value in an attachment?
An attachment is just like any other view (except that it is attached to other views), and so can be manipulated as such: 

In template.php:

function THEMENAME_preprocess_views_view_fields(&amp;$vars) {
  if (isset($vars['view']-&gt;name) &amp;&amp; $vars['view']-&gt;name == 'VIEW_NAME' &amp;&amp; $vars['view']-&gt;current_display == 'ATTACHMENT_NAME') {
    foreach ($vars['fields'] as $id =&gt; $field) {
      if ($id == 'FIELD_NAME') {
        $vars['fields'][$id]-&gt;content = 'new value';
      }
    }
  }
}


Remember to clear your cache.