{"id":9280,"date":"2010-05-28T15:06:07","date_gmt":"2010-05-28T15:06:07","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/sort-query-by-post-in\/"},"modified":"2012-10-20T19:31:10","modified_gmt":"2012-10-20T19:31:10","slug":"sort-query-by-post-in","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/sort-query-by-post-in\/","author":1973938,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2.3","stable_tag":"1.2.3","tested":"3.4.2","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"Sort Query by Post In","header_author":"Jake Goldman, 10up, Oomph","header_description":"","assets_banners_color":"","last_updated":"2012-10-20 19:31:10","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/10up.com\/plugins\/sort-query-by-post-in-wordpress\/","header_plugin_uri":"http:\/\/10up.com\/plugins\/sort-query-by-post-in-wordpress\/","header_author_uri":"http:\/\/10up.com","rating":5,"author_block_rating":0,"active_installs":10,"downloads":4239,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.2.3":"<p>This plug-in has been folded into WordPress 3.5. If you are running 3.5 or newer, it will self-deactivate.<\/p>","1.2.1":"<p>Do not upgrade if you&#039;re using a version of WordPress older than 3.0; support for pre-3.0 has been dropped.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1","1.2","1.2.1","1.2.2","1.2.3"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[2275,4647,58423,1626,50159],"plugin_category":[],"plugin_contributors":[77761,77760,77762],"plugin_business_model":[],"class_list":["post-9280","plugin","type-plugin","status-closed","hentry","plugin_tags-developer","plugin_tags-orderby","plugin_tags-post-query","plugin_tags-query","plugin_tags-wp-query","plugin_contributors-10up","plugin_contributors-jakemgold","plugin_contributors-thinkoomph","plugin_committers-jakemgold"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/sort-query-by-post-in.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>NOTE: This plug-in has been incorporated into WordPress core as of version 3.5.<\/p>\n\n<p>Sort Query by Post In is a very light weight (less than 10 lines of code) plug-in intended for developers executing custom post queries. You're welcome to include it in your theme and redistribute - just offer us some credit, please!<\/p>\n\n<p>When constructing a WordPress post query in your theme template files or plug-in, WordPress offers the option to explicitly specify the posts to retrieve using the <code>post__in<\/code> parameter. Unfortunately, the <code>orderby<\/code> parameter does not offer an option that will sort the result by the exact order passed in the <code>post__in<\/code> parameter. This plug-in adds a <code>post__in<\/code> option for the <code>orderby<\/code> parameter that will order the result by the exact order specified in the <code>post__in<\/code> parameter.<\/p>\n\n<p>And don't worry about the plug-in being deactivated - your post queries with the new <code>post__in<\/code> value used for <code>orderby<\/code> will simply gracefully fall back to the default date sorting.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install easily with the WordPress plugin control panel or manually download the plugin and upload the extracted\nfolder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Modify the appropriate post queries with the <code>orderby<\/code> parameter set to <code>post__in<\/code><\/li>\n<\/ol>\n\n<h4>Example<\/h4>\n\n<pre><code>query_posts( array( 'post__in' =&gt; array(20,10,106),  'orderby' =&gt; 'post__in' ) );\n<\/code><\/pre>\n\n<p>That will retrieve posts with IDs 20, 10, and 106 in that order!<\/p>\n\n<!--section=changelog-->\n<h4>1.2.3<\/h4>\n\n<ul>\n<li>Automatically deactivates under WordPress 3.5 or newer (as it was folded into core)<\/li>\n<\/ul>\n\n<h4>1.2.2<\/h4>\n\n<ul>\n<li>Teeny code simplication, update support information<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>Dropped support for WordPress pre-3.0 (even lighter!)<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Slightly more careful conditional check for sorting by <code>post__in<\/code><\/li>\n<\/ul>","raw_excerpt":"A very simple plug-in that allows post queries to sort the results by the order specified in the &quot;post__in&quot; parameter.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/9280","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=9280"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jakemgold"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=9280"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=9280"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=9280"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=9280"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=9280"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=9280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}