Skip to content

Instantly share code, notes, and snippets.

@sbruner
Created January 15, 2016 04:23
Show Gist options
  • Save sbruner/a8134fbd574694de105b to your computer and use it in GitHub Desktop.
Save sbruner/a8134fbd574694de105b to your computer and use it in GitHub Desktop.
Piklist: field: file: retrieve data
<?php
$myupload = get_post($id);
$title = $myupload->post_title;
$description = $myupload->post_content;
$caption = $myupload->post_excerpt;
echo 'title:' . $title;
echo 'description:' . $description;
echo 'caption:' . $caption;
echo '<img src="' . wp_get_attachment_url($id) . '"/>';
print_r($myupload); // Displays all data
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment