You are here

function crumbs_InjectedAPI_hookCrumbsPlugins::entityParentCallback in Crumbs, the Breadcrumbs suite 7.2

Register a callback that will determine a parent path for a breadcrumb item with an entity route. The behavior will be available for all known entity routes, e.g. node/% or taxonomy/term/%, with different plugin keys.

Parameters

string $key:

callable $callback:

array $types: An array of entity types, or a single entity type, or NULL to allow all entity types.

File

lib/InjectedAPI/hookCrumbsPlugins.php, line 104

Class

crumbs_InjectedAPI_hookCrumbsPlugins
API object to be used as an argument for hook_crumbs_plugins() This is a sandbox class, currently not used..

Code

function entityParentCallback($key, $callback, $types = NULL) {
  $entity_plugin = new crumbs_EntityPlugin_Callback($callback, $this->module, $key, 'entityParent');
  $this
    ->entityPlugin('parent', $key, $entity_plugin, $types);
  $this->callbackCollection
    ->addCallback($this->module, 'entityParent', $key, $callback);
}