You are here

function entityreference_crumbs_plugins in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 7.2 plugins/crumbs.entityreference.inc \entityreference_crumbs_plugins()

Implements hook_crumbs_plugins().

File

plugins/crumbs.entityreference.inc, line 7

Code

function entityreference_crumbs_plugins($api) {
  foreach (field_info_fields() as $key => $info) {
    if ($info['type'] === 'entityreference') {
      foreach ($info['bundles'] as $entity_type => $bundles) {
        $class = '_entityreference_CrumbsMultiPlugin_' . $entity_type;
        if (class_exists($class)) {
          $plugin = new $class($key, $bundles);
          $api
            ->multiPlugin("{$key}.{$entity_type}", $plugin);
        }
      }
    }
  }
  $api
    ->disabledByDefault('*');
}