Custom menu named arguments i was wondering is it possible to create custom menu named arguments in D7. I can do this

function MY_MODULE_menu(){
  $items['my/callback/%user'] = array(
    ...
    'page callback' =&gt; 'MY_MODULE_callback',
    'page arguments' =&gt; array(2),
    ....
  );
}


and it will load the user entity. So instead i want to do this:

function MY_MODULE_menu(){
  $items['my/callback/%my_entity'] = array(
    ...
    'page callback' =&gt; 'MY_MODULE_callback',
    'page arguments' =&gt; array(2),
    ....
  );
}


and my custom entity to be loaded.
Yes, name your function my_entity_load and it will be passed the id.

From the Drupal hook_menu documentation (emphasis mine).


  Auto-Loader Wildcards Registered paths may also contain special
  "auto-loader" wildcard components in the form of '%mymodule_abc',
  where the '%' part means that this path component is a wildcard, and
  the 'mymodule_abc' part defines the prefix for a load function, which
  here would be named mymodule_abc_load(). When a matching path is
  requested, your load function will receive as its first argument the
  path component in the position of the wildcard; load functions may
  also be passed additional arguments (see "load arguments" in the
  return value section below). For example, your module could register
  path 'my-module/%mymodule_abc/edit':

  $items['my-module/%mymodule_abc/edit'] = array(
    'page callback' =&gt; 'mymodule_abc_edit',
    'page arguments' =&gt; array(1),
  );

  
  When path 'my-module/123/edit' is requested, your load function
  mymodule_abc_load() will be invoked with the argument '123', and
  should load and return an "abc" object with internal id 123:

  function mymodule_abc_load($abc_id) {
    return db_query("SELECT * FROM {mymodule_abc} WHERE abc_id = :abc_id", array(':abc_id' =&gt; $abc_id))-&gt;fetchObject();
  }