preprocess_field() not working - what am I doing wrong? I am trying to use mytheme_preprocess_field() to alter how a field is displayed. Here is the code I added to my theme's template.php:

function creative_responsive_theme_preprocess_field(&amp;$vars) {
$element = &amp;$vars['element'];
if ($element['#field_name'] == 'field_myfield') {
   $element['#items'][0]=[];
   $element['#items'][0]['value'] = 'replaced value';
   $element['#items'][0]['format'] = 'filtered_html';
   $element['#items'][0]['safe_value'] ='';
   $element['#items'][0]['#markup'] = 'replaced value';
   return;
 }
}


I confirmed that the code is being executed, but the rendering of the page does not reflect what I have done in the code. The field is being displayed as usual. I am using display suite. Not sure if that effects anything, but searching online, I see no indication that above should not work. And I added the #markup part because I read that is truly what one has to do...

Ideas?

regards
I think it was the # in front of items that was messing things up. I have this working now as

function creative_responsive_theme_preprocess_field(&amp;$variables) {
    if (user_is_logged_in()) {  return $variables;}
//if (in_array($variables['element']['#field_name'], array('field_audio_fast_', 'field_audio_slow_'))) {
    if (($variables['element']['#field_name'] == 'field_audio_fast_') OR ($variables['element']['#field_name'] == 'field_audio_slow_')){
        $variables['items'][0]=[];
        $variables['items'][0]['value'] = '&lt;a href='.'"/user/register?destination=[path]"&gt; &lt;img src="/images/play.gif"&gt;&lt;/a&gt;';
        $variables['items'][0]['format'] = 'full_html';
        $variables['items'][0]['safe_value'] ='';
        $variables['items'][0]['#markup'] = '&lt;a href='.'"/user/register?destination=[path]"&gt; &lt;img src="/images/play.gif"&gt;&lt;/a&gt;';
        return $variables;
    }
}


At first  $variables['items'][0]=[]; was producing a bunch of warnings about invalid arguments to core functions regarding children and parents and rendering. Then I cleared drupal cache. The thing is, the field I am replacing is an audio file field. So I think there must be a cleaner way to do this than above. Let me know if you have suggestions!