{"id":28261,"date":"2014-03-09T18:29:52","date_gmt":"2014-03-09T18:29:52","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/attach-post-images\/"},"modified":"2014-03-09T18:56:50","modified_gmt":"2014-03-09T18:56:50","slug":"attach-post-images","status":"publish","type":"plugin","link":"https:\/\/azb.wordpress.org\/plugins\/attach-post-images\/","author":13364157,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"1.0.1","tested":"3.7.41","requires":"3.5","requires_php":"","requires_plugins":"","header_name":"Attach Post Images","header_author":"Cyril Tata","header_description":"","assets_banners_color":"","last_updated":"2014-03-09 18:56:50","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/goo.gl\/m4r02B","header_plugin_uri":"http:\/\/cyriltata.blogspot.com\/2014\/03\/wordpress-plugin-attach-post-images.html","header_author_uri":"http:\/\/cyriltata.blogspot.com","rating":0,"author_block_rating":0,"active_installs":100,"downloads":3573,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0.1":"<ul>\n<li>rename plugin<\/li>\n<\/ul>","1.0":"<ul>\n<li>fix plugin name<\/li>\n<li>fix plugin name 2<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"872326","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"872326","resolution":"2","location":"assets"}},"screenshots":{"1":"Metabox on the right of the edit screen with no images selected","2":"Metabox showing selected images"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[9029,9031,9030,166,162],"plugin_category":[43],"plugin_contributors":[84499],"plugin_business_model":[],"class_list":["post-28261","plugin","type-plugin","status-publish","hentry","plugin_tags-attach-images","plugin_tags-attach-images-to-post","plugin_tags-post-images","plugin_tags-posts","plugin_tags-widget","plugin_category-customization","plugin_contributors-tcyr","plugin_committers-tcyr"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/attach-post-images.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/attach-post-images\/assets\/screenshot-1.png?rev=872326","caption":"Metabox on the right of the edit screen with no images selected"},{"src":"https:\/\/ps.w.org\/attach-post-images\/assets\/screenshot-2.png?rev=872326","caption":"Metabox showing selected images"}],"raw_content":"<!--section=description-->\n<p>Unlike the traditional way of attaching images (or attachments) to posts by inserting them in the post content, this plugin allows you to attach images to posts in a manner\nthat lets you control the way the images are later displayed in your theme.<\/p>\n\n<p>It adds a metabox to the edit screen that lets you select\/upload images (similar to the \"Featured Image\" metabox).<\/p>\n\n<p>The images attached to a post can then later be gotten by the following means:<\/p>\n\n<ul>\n<li>If you are in a WordPress loop then you can use the tag <code>twp_the_post_images($size)<\/code>. \n<em>$size (string|array)<\/em> is an optional parameter (defaults to '<em>thumbnail<\/em>') and can take values similar to the <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_get_attachment_image_src\" title=\"wp_get_attachment_image_src\">wp_get_attachment_image_src<\/a> function.<\/li>\n<\/ul>\n\n<p>This will return an array of objects where each object contains information about an image.<\/p>\n\n<ul>\n<li>You can directly call the plugin function <code>twp_get_post_images($post_id, $size)<\/code>.<\/li>\n<\/ul>\n\n<p><em>$post_id (int)<\/em>: required - the ID of the post.<\/p>\n\n<p><em>$size (string|array)<\/em>: is an optional parameter (defaults to '<em>thumbnail<\/em>') and can take values similar to the <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_get_attachment_image_src\" title=\"wp_get_attachment_image_src\">wp_get_attachment_image_src<\/a> function.<\/p>\n\n<p>This will return an array of objects where each object contains information about an image.<\/p>\n\n<ul>\n<li>If you want to display the images directly as an unordered list, then you can use the shortcode <code>[twp_post_images id=post_id size=some_size]<\/code>.\nThe parameters of this shortcode are same as those of the above functions.\nYou will need some CSS knowledge to style the returned unordered list properly.<\/li>\n<\/ul>\n\n<p>The functions <code>twp_the_post_images()<\/code> and <code>twp_get_post_images()<\/code> return an empty array if no images were found or an array of objects where each object has the following attributes:<\/p>\n\n<ul>\n<li><em>id<\/em>: the attachment id<\/li>\n<li><em>width<\/em>: The width of the image<\/li>\n<li><em>height<\/em>: The height of the image<\/li>\n<li><em>orientation<\/em>: The orientation of the image (landscape|protrait)<\/li>\n<li><em>url<\/em>: The url of the image<\/li>\n<li><em>is_original<\/em>:  (boolean) false if $url is a resized image, true if it is the original.<\/li>\n<\/ul>\n\n<p><strong>NOTE THAT YOU HAVE TO SAVE\/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION<\/strong><\/p>\n\n<!--section=installation-->\n<p>Steps to install this plugin.<\/p>\n\n<ol>\n<li>In the downloaded zip file, there is a folder with name 'attach-post-images'<\/li>\n<li>Upload the 'attach-post-images' folder to the '\/wp-content\/plugins\/' directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Read the usage instructions in the description.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I attach images to a post?<\/dt>\n<dd><p>First ensure the plugin is enabled. On the editor screen, there is a meta box on the right with link \"Attach Images\". This launches the WordPress media manager, where you can select existing images or upload new images.<\/p><\/dd>\n<dt>How do I get attached images?<\/dt>\n<dd><p>In a WP loop, you can do <code>$images = twp_the_post_images();<\/code><\/p>\n\n<p>Or you can call the plugin function <code>$images = twp_get_post_images($post_id)<\/code>. See plugin description for return values.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial version of plugin<\/li>\n<\/ul>","raw_excerpt":"Attach images to posts (independent of post content) and control post images display.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/28261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=28261"}],"author":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tcyr"}],"wp:attachment":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=28261"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=28261"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=28261"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=28261"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=28261"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=28261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}