Skip to content

Instantly share code, notes, and snippets.

@vladdancer
Created September 13, 2013 10:01
Show Gist options
  • Save vladdancer/6548754 to your computer and use it in GitHub Desktop.
Save vladdancer/6548754 to your computer and use it in GitHub Desktop.
Wildcard Example
<?php
/**
* Wildcard loader for '%master_class'
* Add additional check after node_load() func.
* @param $nid
* @return bool|mixed
*/
function master_class_load($nid) {
$node = node_load($nid);
$condition = $node->type == 'master_class' && $node->status == 1;
return $condition ? $node : FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment