function rabbit_hole_get_action in Rabbit Hole 7.2
Determines the actual action for an entity.
This will check the action for an entity, and if it's set to the bundle default, it will check the bundle action.
Parameters
string $entity_type: The entity type that we're checking.
object $entity: The entity that we're checking.
Return value
int The Rabbit Hole action that should be performed.
2 calls to rabbit_hole_get_action()
- rabbit_hole_execute in ./
rabbit_hole.module - Determines the action that should be executed.
- rabbit_hole_menu_local_tasks_alter in ./
rabbit_hole.module - Implements hook_menu_local_tasks_alter().
File
- ./
rabbit_hole.module, line 490 - Main module file for Rabbit Hole.
Code
function rabbit_hole_get_action($entity_type, $entity) {
$bundle = rabbit_hole_entity_get_bundle($entity_type, $entity);
return isset($entity) && isset($entity->rh_action) && rabbit_hole_get_override_bundle($entity_type, $bundle) ? $entity->rh_action != RABBIT_HOLE_USE_DEFAULT ? $entity->rh_action : rabbit_hole_get_action_bundle($entity_type, $bundle) : rabbit_hole_get_action_bundle($entity_type, $bundle);
}