You are here

public static function FeedImportFilter::prepend in Feed Import 8

Same name in this branch
  1. 8 feed_import_base/filters/feed_import_default_filters.php \FeedImportFilter::prepend()
  2. 8 feed_import_base/src/Filter/FeedImportFilter.php \Drupal\feed_import_base\FeedImportFilter::prepend()
Same name and namespace in other branches
  1. 7.3 feed_import_base/filters/feed_import_default_filters.php \FeedImportFilter::prepend()
  2. 7 feed_import_filter.inc.php \FeedImportFilter::prepend()
  3. 7.2 feed_import_filter.inc.php \FeedImportFilter::prepend()

Prepend text

Parameters

mixed $field: A string or an array of strings

string $text: Text to prepend

Return value

mixed A string or an array of strings with text prepended

File

feed_import_base/filters/feed_import_default_filters.php, line 410
Provides filters for feed import.

Class

FeedImportFilter
This class contains default filters for feed import.

Code

public static function prepend($field, $text) {
  if (is_array($field)) {
    foreach ($field as &$f) {
      $f = self::prepend($f, $text);
    }
    return $field;
  }
  return $text . $field;
}