A previous commenter on Alex Mills' blog (2013) suggested this solution in comments.
find:
case ‘post_type’:
// Using get_pages() instead of get_posts() because we want ALL descendants
$children = get_pages( array(
‘child_of’ => $item->object_id,
‘post_type’ => $item->object,
‘sort_column’ => ‘menu_order, post_title’,
) );
and change to:
case ‘post_type’:
// Using get_pages() instead of get_posts() because we want ALL descendants
/* Edit by gbmhunter to remove grandchildren. Removed the following
$children = get_pages( array(
‘child_of’ => $item->object_id,
‘post_type’ => $item->object,
‘sort_column’ => ‘menu_order, post_title’,
) );
*/
/* And added this */
$children = get_pages(‘child_of=’.$item->object_id.’&parent=’.$item->object_id);
but it doesn't currently appear to work.