title: custom meta box image field. Not getting image
body: <p>I am using a plugin for custom meta box. Image is uploaded through the dashboard of the admin panel. Now i want to show this image and my required place. I have tried different methods and functions but it is not working. It gets the id of the image but not he image.</p>
  
  <p><strong>Code for custom meta box image field to register</strong></p>
  
  <pre><code> add_filter( 'rwmb_meta_boxes', 'your_prefix_meta_boxes' );
   function your_prefix_meta_boxes( $meta_boxes ) {
   $meta_boxes[] = array(
      'title'      =&gt; __( 'Image Gallery', 'textdomain' ),
      'post_types' =&gt; 'events',
      'fields'     =&gt; array(
          array(
              'name' =&gt; __( 'Image Upload', 'your-prefix' ),
              'id'   =&gt; $prefix . 'test_image',
              'type' =&gt; 'image_advanced',
               ),
  
          ),
      );
   return $meta_boxes;
  }
  </code></pre>
  
  <p><strong>method 1 for getting image</strong></p>
  
  <pre><code>  $post_meta_data = get_post_meta($post-&gt;ID, $prefix.'test_image', true);
    var_dump($post_meta_data);
      if (!empty($post_meta_data[0])) {
          $custom_image =  wp_get_attachment_image($post_meta_data[0], 'thumbnail');
          var_dump($custom_image);
      }
      echo $custom_image
  </code></pre>
  
  <p>it shows the id of the image.</p>
  
  <p><strong>method 2</strong></p>
  
  <pre><code>            $images = get_post_meta( $post-&gt;ID, $prefix.'test_image', true);
              var_dump($images);
  
              if ( $images ) {
                  var_dump($images);
                   foreach ( $images as $attachment_id =&gt; $img_full_url ) {
  
                      $full = wp_get_attachment_link($attachment_id, 'full');
  
                          echo "&lt;li&gt;";
                          echo $full;
                          echo "&lt;/li&gt;";
  
                  }
              }
  </code></pre>
  
  <p>it gives the error that invalid argument to for each loop. </p>