WP childs menu

<?php
  $theParent = wp_get_post_parent_id(get_the_ID());
  $allPages = get_pages(array(
    'child_of' => get_the_ID()
  ));

  if ($theParent or $allPages) { ?>
  <div class="page-links">
    <h5><a href="<?php echo get_permalink($theParent); ?>"><?php echo get_the_title($theParent); ?></a></h5>
    <ul>
      <?php
        if ($theParent) {
          $findChildrenOf = $theParent;
        } else {
          $findChildrenOf = get_the_ID();
        }

        wp_list_pages(array(
          'title_li' => NULL,
          'child_of' => $findChildrenOf,
          'sort_column' => 'menu_order'
        ));
      ?>
    </ul>
  </div>
<?php } ?>