{"id":7329,"date":"2009-11-19T22:02:25","date_gmt":"2009-11-19T22:02:25","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-get-post-image\/"},"modified":"2010-06-26T10:36:04","modified_gmt":"2010-06-26T10:36:04","slug":"wp-get-post-image","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/wp-get-post-image\/","author":40142,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.2","stable_tag":"trunk","tested":"3.0.5","requires":"2.8.4","requires_php":"","requires_plugins":"","header_name":"WP Get Post Image","header_author":"Michael Wender","header_description":"","assets_banners_color":"","last_updated":"2010-06-26 10:36:04","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/michaelwender.com","header_plugin_uri":"http:\/\/michaelwender.com\/wordpress\/plugins\/wp-get-post-image\/","header_author_uri":"http:\/\/michaelwender.com\/","rating":0,"author_block_rating":0,"active_installs":100,"downloads":10576,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1346,1759,163,31380,3623],"plugin_category":[50],"plugin_contributors":[83246],"plugin_business_model":[],"class_list":["post-7329","plugin","type-plugin","status-publish","hentry","plugin_tags-attachments","plugin_tags-function","plugin_tags-images","plugin_tags-post-image","plugin_tags-template-tag","plugin_category-media","plugin_contributors-thewebist","plugin_committers-thewebist"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-get-post-image.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin provides the template tag <code>wp_get_post_image()<\/code>. Use it to call dynamically created images uploaded via the WordPress media uploader.<\/p>\n\n<p>NOTE: This plugin is intended for use by WordPress developers and theme builders only.<\/p>\n\n<h4>Usage<\/h4>\n\n<pre><code>&lt;?php wp_get_post_image($args); ?&gt;\n<\/code><\/pre>\n\n<h4>Default Usage<\/h4>\n\n<pre><code>&lt;?php $args = array(\n    'width' =&gt; null,\n    'height' =&gt; null,\n    'css' =&gt; '',\n    'parent_id' =&gt; '',\n    'post_id' =&gt; '',\n    'filename' =&gt; '',\n    'return_html' =&gt; true       \n); ?&gt;\n<\/code><\/pre>\n\n<p>By default, the function returns:<\/p>\n\n<ul>\n<li>The last uploaded image wrapped in an image tag (<code>&lt;img \/&gt;<\/code>).<\/li>\n<li>A proportionately sized image with a <code>width<\/code> no greater than <code>200px<\/code>.<\/li>\n<li>The CSS class <code>wp-image-*ID*<\/code> and no other classes.<\/li>\n<li>If you add <code>thickbox<\/code> via <code>css<\/code>, the appropriate anchor <code>&lt;a&gt;<\/code> tag will be added for Thickbox compatibility.<\/li>\n<\/ul>\n\n<h4>Parameters<\/h4>\n\n<ul>\n<li><p><strong>width<\/strong> (<em>integer<\/em>) - Width of image.<\/p><\/li>\n<li><p><strong>height<\/strong> (<em>integer<\/em>) - Height of image.<\/p><\/li>\n<li><p><strong>parent_id<\/strong> (<em>integer<\/em>) - The ID of the <code>post_parent<\/code> for the attachment. Specifying the <code>parent_id<\/code> returns the first image attached to the parent post according to <code>menu_order<\/code>.<\/p><\/li>\n<li><p><strong>post_id<\/strong> (<em>integer<\/em>) - The ID of the attachment.<\/p><\/li>\n<li><p><strong>filename<\/strong> (<em>string<\/em>) - The filename that corresponds to the <code>post_name<\/code> of the attachment.<\/p><\/li>\n<li><p><strong>return_html<\/strong> (<em>boolean<\/em>) - <code>true<\/code> returns the image wrapped in an XHTML image tag. <code>false<\/code> returns the image's URL.<\/p><\/li>\n<\/ul>\n\n<h4>Example<\/h4>\n\n<pre><code>&lt;?php \n\/\/ use this example wherever you have access to $post-&gt;ID, e.g. the WordPress loop\nif(function_exists('wp_get_post_image'))\n    echo wp_get_post_image('width=450&amp;css=alignleft&amp;parent_id='.$post-&gt;ID);  \n?&gt;\n<\/code><\/pre>\n\n<!--section=installation-->\n<p>Install the plugin as follows:<\/p>\n\n<ol>\n<li>Upload the folder <code>wp-get-post-image<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Place <code>&lt;?php echo wp_get_post_image(); ?&gt;<\/code> in your templates<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>No questions yet.<\/p>\n\n<!--section=changelog-->\n<h4>0.2 (2010-01-26)<\/h4>\n\n<ul>\n<li>Adjusted <code>$image-&gt;basepath<\/code> to reference <code>get_bloginfo('wpurl')<\/code> instead of <code>get_bloginfo('url')<\/code>. This makes the plugin work when WordPress is installed in one directory while the blog displays in another. (HT: <a href=\"http:\/\/mikecohenmedia.com\/\" title=\"Mike Cohen Media\">Mike Cohen<\/a>)<\/li>\n<\/ul>\n\n<h4>0.1 (2009-11-23)<\/h4>\n\n<ul>\n<li>first version<\/li>\n<\/ul>","raw_excerpt":"Adds the function wp_get_post_image(), giving theme builders easy access to images associated with a post or page.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/7329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=7329"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/thewebist"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=7329"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=7329"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=7329"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=7329"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=7329"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=7329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}