Leave a Reply

2 comments

  1. This works for me:

    <?php
    foreach ( $attachments as $attachment_id => $attachment ) {
        $src = wp_get_attachment_image_src( $attachment_id, 'full' );
        var_dump($src);
    } ?>
    
    
    array
      0 => string 'http://example.com/wp-content/uploads/2009/08/DSC00261.JPG' (length=63)
      1 => int 1632
      2 => int 1224
      3 => boolean false
    

    The order of the array is allocated as follows.

    $src[0] => url
    $src[1] => width
    $src[2] => height
    $src[3] => icon