title: Wordpress wp_list_pages walker with featured image captions
body: <p>I have created a custom walker for wp_list_pages() in Wordpress. This walker displays the featured images of the pages in question. My problem is that I need to also show the caption of these featured images. At the moment this is just showing the title of the page, I don't know how to get the featured image caption instead.</p>
  
  <p>Here is my walker:</p>
  
  <pre><code>class SlideshowPics_walker extends Walker_page {
      function start_el( &amp;$output, $page, $depth, $args, $current_page = 0 ) {
          if(has_post_thumbnail($page-&gt;ID)){
              $image = wp_get_attachment_image_src( get_post_thumbnail_id( $page-&gt;ID ), 'main-featured-thumbnail' );
              $link_title = $link_before . '&lt;img src="'.$image[0].'" alt="'.esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page-&gt;post_title, $page-&gt;ID ) ) ).'"/&gt;&lt;div class="caption"&gt;'.apply_filters( 'the_title', $page-&gt;post_title, $page-&gt;ID ). $link_after.'&lt;/div&gt;';
          } else
          $link_title= $link_before . apply_filters( 'the_title', $page-&gt;post_title, $page-&gt;ID ) . $link_after;
          $output .= $indent . '&lt;li class="' . $css_class . '"&gt;&lt;a href="' . get_permalink($page-&gt;ID) . '"&gt;' . $link_title . '&lt;/a&gt;'
          .'&lt;/li&gt;';
      }
  }
  </code></pre>