• Resolved chodorowicz

    (@chodorowicz)


    Hey!
    Do You know how to get the url of an image attachment, but not the original one but the edited/scaled/cropped version? When I use this function I get all the time the original version and codex doesn’t tell how to get the version after edits

    Thanks in advance for help

Viewing 3 replies - 1 through 3 (of 3 total)
  • codex doesn’t tell how to get the version after edits

    Oh yes it does!

    <?php wp_get_attachment_image_src( $attachment_id, $size, $icon ); ?>

    $size
    (string/array) (optional) Size of the image shown for an image attachment: either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32). As of Version 2.5, this parameter does not affect the size of media icons, which are always shown at their original size.

    Default: thumbnail

    http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

    Thread Starter chodorowicz

    (@chodorowicz)

    But as I mentioned in my post I’m not interested in any of these 4 sizes (“thumbnail, medium, large or full”) – I need the url to the image which is created after users edits image using the “Edit Image” functionality introduced in WP 2.9

    After you use this functionality a 5th file is created in Upload folders (5th after original file and three standard sizes) and I need url to this 5th image

    Thread Starter chodorowicz

    (@chodorowicz)

    OK, kind of “my bad” – when I use the “the full option:
    $src = wp_get_attachment_image_src( $result->ID, 'full');
    I get the url which I need
    Problem solved. Thanks for guiding me through!
    Greetings

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get attachment image of edited/scaled size’ is closed to new replies.