What is the best way to retrieve the current menu object, regardless of it's type? When you call menu_get_object(), the first argument defaults to 'node' if no arguments are passed to the function. The code uses the $type variable to check if the current object is of that type, using $router_item['load_functions'][$position] == $type . '_load'.

Sometimes, I just want to get the current menu object, regardless of it's type. In other words, when I'm looking at user/123, I want the user object, and when I'm viewing node/456, I want the node object.

Why does menu_get_object force a single entity type?

What is the best way to retrieve the current menu object, regardless of it's type?
As you can see in that function, it does nothing more than:

$router_item = menu_get_item($path);
return $router_item['map'][$position];


However, I'm not sure how that will help you, for pretty much all objects, you need to know what it is to work with it as there are just some attributes.