You are here

function easy_social_get_supported_entities in Easy Social 8.3

Same name and namespace in other branches
  1. 8.4 easy_social.module \easy_social_get_supported_entities()

Returns entity types we want to attach an extra Easy Social pseudo-field to.

Return value

array An array of entity types.

2 calls to easy_social_get_supported_entities()
easy_social_entity_view in ./easy_social.module
Implements hook_entity_view().
easy_social_field_extra_fields in ./easy_social.module
Implements hook_field_extra_fields().

File

./easy_social.module, line 410
Easy Social module.

Code

function easy_social_get_supported_entities() {
  static $supported_entity_types;
  if (!isset($supported_entity_types)) {

    // Support only core by default.
    $supported_entity_types = array(
      'comment',
      'file',
      'node',
      'taxonomy_term',
      'user',
    );

    // Other modules can easily enable support for others.
    // @TODO add API documentation if we end up keeping this.
    \Drupal::moduleHandler()
      ->alter('easy_social_supported_entity', $supported_entity_types);
  }
  return $supported_entity_types;
}