{"id":101701,"date":"2011-01-19T08:00:00","date_gmt":"2011-01-19T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/list-attachments-shortcode\/"},"modified":"2013-01-30T04:26:00","modified_gmt":"2013-01-30T04:26:00","slug":"list-attachments-shortcode","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/list-attachments-shortcode\/","title":{"rendered":"List Attachments Shortcode"},"content":{"rendered":"<p>This WordPress plug-in allows users to easily list all of the attachments associated with a specific post or page within WordPress. For instance, if you want to create a long list of Word documents or PDF documents, you can simply attach them to the page or post, then insert the shortcode where you\u2019d like that list to appear.<\/p>\n<h4>Usage<\/h4>\n<p>The simplest way to use this plug-in is just to use the shortcode. That will, by default, list the attachments with the most recent upload at the top of the list and the oldest upload at the end of the list. No heading will be included above the list. The list will be created as an unordered list with the CSS class of \u201cattachment-list\u201d.<\/p>\n<p>[list-attachments]<\/p>\n<h4>Options<\/h4>\n<ul>\n<li>type \u2013 a comma-separated list of file extensions that should be included in the list. If this is left empty, all attachments will be included<br \/>\norderby \u2013 any of the values that can be used with the WordPress query_posts() function<\/li>\n<li>order \u2013 indicate whether the list should be sorted in ascending or descending order<\/li>\n<li>groupby \u2013 if you would like the list split into specific groups, you can indicate any of the WordPress post object parameters as the value of this property. For instance, you can use a common \u201cdescription\u201d for your attachments to organize them into groups. In that case, you would use \u201cpost_content\u201d as the \u201cgroupby\u201d parameter for this shortcode<\/li>\n<li>before_list \u2013 any HTML code you want to appear before the list begins<br \/>\nopening \u2013 the opening tag(s) for the list (defaults to <\/p>\n<ul class=\u201dattachment-list\u201d>)<\/li>\n<li>closing \u2013 the closing tag(s) for the list (defaults to <\/ul>\n<p>)<\/li>\n<li>before_item \u2013 the opening tag(s) for each item of the list (defaults to\n<li>)<\/li>\n<li>after_item \u2013 the closing tag(s) for each item of the list (defaults to <\/li>\n<p>)<\/li>\n<\/ul>\n<p>This is the first version of this plug-in, so I\u2019m certain there are a lot of features that still need to be added and bugs that need to be worked out. If you try out the plug-in and have any suggestions or notice any issues, please comment on this post and let us know.<\/p>\n<h3>Known Issues<\/h3>\n<ul>\n<li>The HTML code arguments (before_list, after_list, before_item, after_item, etc.) only work when added through the visual editor. When added through the HTML editor, they are not sent properly through the shortcode.<\/li>\n<\/ul>\n<h3>To Do<\/h3>\n<ul>\n<li>Re-do the method of handling the HTML code arguments<\/li>\n<li>Remove the handful of hard-coded HTML elements that are in the plug-in, making them configurable through shortcode arguments<\/li>\n<li>Add a widget to the plugin<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Adds a shortcode to display a list of files attached to a post.<\/p>\n","protected":false},"author":65,"featured_media":301321,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"List Attachments Shortcode - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Adds a shortcode to display a list of files attached to a post."},"footnotes":""},"categories":[1],"tags":[1931,619,345],"class_list":["post-101701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-attachments","tag-list","tag-shortcode"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/101701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=101701"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/101701\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/301321"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=101701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=101701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=101701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}