1.20.x redirect.module redirect_entity_type_supports_redirects($entity_type)

Check if an entity type supports redirects.

Parameters

$entity_type: An entity type.

Return value

bool: TRUE if the entity type has specified that it supports redirects in hook_entity_info(). FALSE otherwise.

See also

hook_entity_info()

File

modules/redirect/redirect.module, line 266

Code

function redirect_entity_type_supports_redirects($entity_type) {
  $types = &backdrop_static(__FUNCTION__);

  if (!isset($types)) {
    $types = array();
    foreach (entity_get_info() as $type => $entity_info) {
      $types[$type] = !empty($entity_info['redirect support']);
    }
  }

  return isset($types[$entity_type]) ? $types[$entity_type] : FALSE;
}