Skip to content

Instantly share code, notes, and snippets.

@markdorison
Created August 19, 2011 19:46
Show Gist options
  • Save markdorison/1157808 to your computer and use it in GitHub Desktop.
Save markdorison/1157808 to your computer and use it in GitHub Desktop.
Get current nid
function _get_argument_nid() {
foreach (range(1, 3) as $i) {
$node = menu_get_object('node', $i);
if (!empty($node)) {
return $node->nid;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment