Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisChinchilla/2582a8ec0365031e599d to your computer and use it in GitHub Desktop.
Save ChrisChinchilla/2582a8ec0365031e599d to your computer and use it in GitHub Desktop.
Check if a term has any children in Drupal
$argArray = arg() ;
$finalTerm = end($argArray) ;
$termArray = taxonomy_get_children($finalTerm);
if (empty($termArray)) return TRUE;
$argArray = arg() ;
$finalTerm = end($argArray) ;
$termArray = taxonomy_get_children($finalTerm);
if (!empty($termArray)) return TRUE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment