hook_menu() wildcard problem I can't get the wildcard from a hook_menu to pass it to a callback function

Here is what I have:

function spin_menu() {
    $items = array();

    $items['spin/login/%'] = array(
        'title' =&gt; 'SPIN',
        'type' =&gt; MENU_CALLBACK,
        'access callback' =&gt; TRUE,
        'page callback' =&gt; 'spin_check_access'
    );

    return $items;
}

function spin_check_access($type = '') {
    echo $type; // type is never the %
}


Is it correct? I need the $type to be replaced with the wildcard's value.
You have two options:

function spin_menu() {
  $items = array();

  $items['spin/login'] = array(
    'title' =&gt; 'SPIN',
    'type' =&gt; MENU_CALLBACK,
    'access callback' =&gt; TRUE,
    'page callback' =&gt; 'spin_check_access',
  );

  $items['spin/login/%'] = array(
    'title' =&gt; 'SPIN',
    'type' =&gt; MENU_CALLBACK,
    'access callback' =&gt; TRUE,
    'page callback' =&gt; 'spin_check_access',
    'page arguments' =&gt; array(2),
  );

  return $items;
}


Hook menu will not send any wildcard params to the callback function, but it will send params not defined in the url. So in the first example if you go to spin/login type will be '' and spin/login/foo type will be foo. For the second example spin/login will return 404 and for spin/login/foo type will be foo.