Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

How to retrieve image Caption, Alt Text and Description?

$
0
0

Setup:
-I've assigned a [custom field group] with an [image] field to a [custom post type].
-The images I select are coming from the Media library and have a [caption], [alt text] and [description] set

Problem:
-When I get the $post data, I can only see the image URL but not the [caption], [alt text] and [description].

<?php var_dump(get_post_meta($post->ID)); ?>

["_wpcf-product-image-sort-order"]=>
array(1) {
[0]=>
string(26) "a:2:{i:0;i:738;i:1;i:739;}"
}

["wpcf-product-image"]=>
array(2) {
[0]=>
string(71) "http://example.org/wp-content/uploads/2014/06/lg1.jpg"
[1]=>
string(71) "http://example.org/wp-content/uploads/2014/06/lg2.jpg"
}
}

Question:
-How can I get the [caption], [alt text] and [description] for the images?

note: wpcf-product-image-sort-order gives me 2 numbers (738,739). I don't know what they represent but they are NOT the ID of the images in question


Viewing all articles
Browse latest Browse all 20145

Trending Articles