• add_filter('the_content', 'alc_image_spanner');
    
      function alc_image_spanner($text) {
        $text = preg_replace_callback("#<img(.*?)>#is", create_function('$matches', 'return "<span><img".$matches[1]."></span>";'), $text);
        return $text;
      }

    when i add a class like this

    add_filter('the_content', 'alc_image_spanner');
    
      function alc_image_spanner($text) {
        $text = preg_replace_callback("#<img(.*?)>#is", create_function('$matches', 'return "<span class="gallery"><img".$matches[1]."></span>";'), $text);
        return $text;
      }

    i get FATAL ERROR : SCREAM: Error suppression ignored for […]

    any help would be great thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add class to this php code?’ is closed to new replies.