title: wp_list_pages Title attribute and Order
body: <p>I found a post on this site to add a custom "mytheme_list_pages" to the functions.php file in order to add the title attribute to a link. While this works to add the title attribute to the "href" output, it no longer preserves the order of the menu as wp_list_pages does. Can someone tell me how to order the output of the custom code below?</p>
  
  <p>I'm calling the function from my page.php file like this:</p>
  
  <pre><code>&lt;?php mytheme_list_pages('exclude=819&amp;title_li='); ?&gt;
  </code></pre>
  
  <p>The custom function below:</p>
  
  <pre><code>&lt;?php 
  function mytheme_list_pages($param) {
    $pages = get_pages($param); 
    foreach ( $pages as $page ) {
      $li  = '&lt;li&gt;&lt;a href="' . get_page_link( $page-&gt;ID ) . '" title="';
      $li .= esc_attr($page-&gt;post_title);
      $li .= '"&gt;';
      $li .= $page-&gt;post_title;
      $li .= '&lt;/a&gt;&lt;/li&gt;';
      echo $li;
    }
  }
  ?&gt;
  </code></pre>
  
  <p>Many thanks!</p>