function _social_core_find_image_field in Open Social 8.3
Same name and namespace in other branches
- 8.9 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.2 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.4 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.5 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.6 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.7 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 8.8 modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 10.3.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 10.0.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 10.1.x modules/social_features/social_core/social_core.module \_social_core_find_image_field()
- 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.
- template_preprocess_page_hero_data in modules/
social_features/ social_core/ social_core.module - Prepares variables for the social page hero data.
File
- modules/
social_features/ social_core/ social_core.module, line 118 - The Social core module.
Code
function _social_core_find_image_field(FieldItemList $field) {
if (strpos($field
->getName(), 'image') !== FALSE) {
return $field;
}
return NULL;
}