Skip to content

Instantly share code, notes, and snippets.

@jasondmoss
Last active August 26, 2017 13:30
Show Gist options
  • Save jasondmoss/7344327 to your computer and use it in GitHub Desktop.
Save jasondmoss/7344327 to your computer and use it in GitHub Desktop.
Current post has Children?
<?php
/**
* Whether current post has children
*
* @param integer $postId
*
* @return boolean
* @access public
*/
function hasChildren($postId)
{
$children = get_pages("child_of={$postId}");
return (0 != count($children));
}
/* <> */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment