title: How to get meta attributes (title , alt ,...) of wordpress gallery images?
body: <p>I have used this function to format default wordpress galley theme to my bootstrap theme and works fine. But when I call "image_alt" and "image_title" have no success.</p>
  
  <p>Any help, please? Thank You!</p>
  
  <pre><code>add_filter( 'post_gallery', 'bootstrap_gallery', 10, 3 );
  
  function bootstrap_gallery( $output = '', $atts, $instance )
  {
      $atts = array_merge(array('columns' =&gt; 3), $atts);
  
      $columns = $atts['columns'];
      $images = explode(',', $atts['ids']);
  
      $col_class = 'img-box col-sm-4 col-xs-6 col-xxs-12 no-padding wow flipInX animated'; // default 3 columns
      if ($columns == 1) { $col_class = 'img-box col-xs-12 no-padding wow flipInX animated';}
      else if ($columns == 2) { $col_class = 'img-box col-xs-6 col-xxs-12 no-padding wow flipInX animated'; }
      // other column counts
  
      $return = '&lt;div class="row gallery"&gt;';
  
      $i = 0;
  
      foreach ($images as $key =&gt; $value) {
  
          if ($i%$columns == 0 &amp;&amp; $i &gt; 0) {
              $return .= '&lt;/div&gt;&lt;div class="row gallery portfolio center"&gt;';
          }
  
          $image_attributes = wp_get_attachment_image_src($value, 'full');
          $image_alt = get_post_meta( $image-&gt;id, '_wp_attachment_image_alt', true);
          $image_title = $attachment-&gt;post_title;
  
          $return .= '
              &lt;div class="'.$col_class.' img-box col-sm-4 col-xs-12 no-padding wow flipInX animated"&gt;
                  &lt;a data-gallery="gallery" href="'.$image_attributes[0].'"&gt;
                      &lt;img src="'.$image_attributes[0].'" alt="'.$image_alt.'" class="img-responsive"&gt;
                  &lt;/a&gt;
                  &lt;div class="title"&gt;'.$image_title.'&lt;/div&gt;
              &lt;/div&gt;';
  
          $i++;
      }
  
      $return .= '&lt;/div&gt;';
  
      return $return;
  }
  </code></pre>