You are here

function _social_core_find_image_field in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  2. 8 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  3. 8.2 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  4. 8.3 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  5. 8.4 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  6. 8.5 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  7. 8.6 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  8. 8.8 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  9. 10.3.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  10. 10.0.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  11. 10.1.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
  12. 10.2.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()

Tries to determine if a field is an image field based on a field name.

Parameters

\Drupal\Core\Field\FieldItemList $field: A field object.

Return value

\Drupal\Core\Field\FieldItemList|null Will return the FieldItemList or null if its not an image field.

2 string references to '_social_core_find_image_field'
Node::preprocessElement in themes/socialbase/src/Plugin/Preprocess/Node.php
Preprocess the variables array if an element is present.
social_core_preprocess_node in modules/social_features/social_core/social_core.module
Implements hook_preprocess_HOOK().

File

modules/social_features/social_core/social_core.module, line 120
The Social core module.

Code

function _social_core_find_image_field(FieldItemList $field) {
  if (strpos($field
    ->getName(), 'image') !== FALSE) {
    return $field;
  }
  return NULL;
}