Skip to content

Instantly share code, notes, and snippets.

@mrded
Created February 12, 2015 15:45
Show Gist options
  • Save mrded/5f62cb52e60f1173cdb5 to your computer and use it in GitHub Desktop.
Save mrded/5f62cb52e60f1173cdb5 to your computer and use it in GitHub Desktop.
Drupal: Get wildcard (node/%node/edit) of the path (node/5/edit).
<?php
/**
* Get menu wildcard from path.
*
* @param $path
* The path, for example node/5/edit.
*
* @return
* Returns wildcard node/%node/edit.
*/
function _get_menu_wildcard($path) {
$item = menu_get_item($path);
return $item['path'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment