{"id":47264,"date":"2012-02-27T17:30:21","date_gmt":"2012-02-27T17:30:21","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/things\/"},"modified":"2012-02-26T00:10:36","modified_gmt":"2012-02-26T00:10:36","slug":"things","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/things\/","author":284759,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1","stable_tag":"0.1","tested":"3.4.2","requires":"3.3","requires_php":"","requires_plugins":"","header_name":"Things","header_author":"mitcho (Michael Yoshitaka Erlewine)","header_description":"","assets_banners_color":"","last_updated":"2012-02-26 00:10:36","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/tinyurl.com\/donatetomitcho","header_plugin_uri":"","header_author_uri":"http:\/\/mitcho.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":724,"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":[]},"plugin_section":[],"plugin_tags":[2007,1794,45161,34750,21277,2008],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-47264","plugin","type-plugin","status-closed","hentry","plugin_tags-cpt","plugin_tags-custom-post-type","plugin_tags-infrastructure","plugin_tags-object-oriented","plugin_tags-objects","plugin_tags-post-type"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/things.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>An object-oriented approach to WordPress queries and custom post types. Un(der)documented beta.<\/p>\n <p>So, here's the idea: anywhere where you need a loop, use <code>get_things()<\/code>, which will return an array-like collection of Things. <code>get_things()<\/code> will return Things from the main query; <code>get_things($query_args)<\/code> will run a new query for you. Each Thing in the collection is a magical object that will make your life better.<\/p>\n <pre><code>foreach ( get_things() as $thing ):     \/\/ get an attribute (object or string)     $author = $thing-&gt;author;     \/\/ echo an attribute with the_* methods     $thing-&gt;the_title();     \/\/ get another Thing     $parent = $thing-&gt;parent; endforeach; <\/code><\/pre>\n <p>Each Thing automatically has properties and associated <code>the_*<\/code> methods for the standard WordPress data and taxonomies associated with that post type. Meta (custom field) properties are created when you specify <code>meta<\/code> in your custom post type arguments. If you want to add custom methods or properties, create a subclass of <code>Thing<\/code> and register that with a particular post type.<\/p>\n\n<!--section=installation-->\n<p>...<\/p>\n\n<!--section=faq-->\n<p>...<\/p>\n\n<!--section=changelog-->\n<h4>0.1<\/h4>\n <ul>\n<li>Initial upload<\/li>\n<\/ul>","raw_excerpt":"An object-oriented approach to WordPress queries and custom post types","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/47264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=47264"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mitchoyoshitaka"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=47264"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=47264"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=47264"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=47264"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=47264"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=47264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}