Sua função acima testa se uma página é uma página filha de alguma outra página, não se ela tem filhos.
Você pode testar os filhos da página atual da seguinte forma:
function has_children() {
global $post;
$children = get_pages( array( 'child_of' => $post->ID ) );
if( count( $children ) == 0 ) {
return false;
} else {
return true;
}
}
Leitura adicional: