{"id":10480,"date":"2010-09-09T08:45:10","date_gmt":"2010-09-09T08:45:10","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/post-sorting-reloaded\/"},"modified":"2012-01-10T11:55:28","modified_gmt":"2012-01-10T11:55:28","slug":"post-sorting-reloaded","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/post-sorting-reloaded\/","author":6891516,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.3","stable_tag":"1.3","tested":"3.3.2","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Post Sorting Reloaded","header_author":"Gab","header_description":"","assets_banners_color":"","last_updated":"2012-01-10 11:55:28","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.gab.ro\/contact\/","header_plugin_uri":"http:\/\/www.gab.ro\/post-sorting-reloaded\/","header_author_uri":"http:\/\/www.gab.ro\/","rating":5,"author_block_rating":0,"active_installs":80,"downloads":9552,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.1":"<p>Added class for selected option in the widget.<\/p>","1.0":"<p>Minor security bug fix for the widget.<\/p>","0.9":"<p>Upgrade! We now have a widget too.<\/p>","0.8":"<p>Initial release. No upgrade notice.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.8","0.9","1.0","1.1","1.2","1.3"],"block_files":[],"assets_screenshots":{"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1538925","resolution":"2","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1538925","resolution":"1","location":"plugin"}},"screenshots":{"1":"Settings screen","2":"Widget screen"}},"plugin_section":[],"plugin_tags":[1406,86,50279,7687,4644],"plugin_category":[43],"plugin_contributors":[84374],"plugin_business_model":[],"class_list":["post-10480","plugin","type-plugin","status-closed","hentry","plugin_tags-alphabetical","plugin_tags-post","plugin_tags-posts_orderby","plugin_tags-reverse","plugin_tags-sort","plugin_category-customization","plugin_contributors-gabro","plugin_committers-gabro"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/post-sorting-reloaded.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/post-sorting-reloaded\/trunk\/screenshot-1.png?rev=1538925","caption":"Settings screen"},{"src":"https:\/\/ps.w.org\/post-sorting-reloaded\/trunk\/screenshot-2.png?rev=1538925","caption":"Widget screen"}],"raw_content":"<!--section=description-->\n<p><strong>Warning: This plugin is no longer supported. It's functionality has been included into a new plugin called <a href=\"http:\/\/wordpress.org\/extend\/plugins\/nano-plugin-manager\/\">Nano Plugin Manager<\/a>.<\/strong><\/p>\n\n<p>The plugin is basically a wrapper for the <code>posts_orderby<\/code> filter. You can sort cateogry pages, author pages, tag pages, pretty much any page that can be targeted with WordPress conditional tags.<\/p>\n\n<p>Posts can be sorted by title, date, excerpt, comment count, content, or any other field in the <code>wp_posts<\/code> table.<\/p>\n\n<p>Just take a look at the first screenshot and everything will become clear :)<\/p>\n\n<p>The plugin also includes a widget that allows regular visitors to sort posts.<\/p>\n\n<p><a href=\"http:\/\/www.gab.ro\/post-sorting-reloaded\/\">Plugin homepage<\/a> here!<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>post-sorting-reloaded<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Can I sort by custom fields?<\/dt>\n<dd><p>Yes and no. In order to sort by custom fields, you also need to use the <code>posts_join<\/code> filter in addition to the <code>posts_orderby<\/code> filter.<\/p>\n\n<p>For the <code>posts_orderby<\/code> filter you can use the plugin, but for the <code>posts_join<\/code> filter, you're going to have to write the code yourself.<\/p>\n\n<p>Just add the following code either in your theme's functions.php or in a new little plugin:<\/p>\n\n<pre><code>add_filter('posts_join', 'my_posts_join');\n\nfunction my_posts_join($join){\n    global $wpdb;\n    $join .= \" LEFT JOIN $wpdb-&gt;postmeta wpmeta ON ($wpdb-&gt;posts.ID = wpmeta.post_id AND wpmeta.meta_key = 'price')\";\n    return $join;\n}\n<\/code><\/pre>\n\n<p>Replace 'price' with whatever your custom field is called.<\/p>\n\n<p>Now you have access to your custom field by using <code>wpmeta.meta_value<\/code> as your Sort Type.<\/p>\n\n<p>Of course, if you need the numerical value of your custom field, you can use something like <code>ABS(wpmeta.meta_value)<\/code>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3<\/h4>\n\n<p>Removed contextual help. The plugin is now tested and works properly for WordPress 3.3.1<\/p>\n\n<h4>1.2<\/h4>\n\n<p>Minor bugfixes.<\/p>\n\n<h4>1.1<\/h4>\n\n<p>Added class for selected option in the widget.<\/p>\n\n<h4>1.0<\/h4>\n\n<p>Everything is working properly. Minor security bug fixed.<\/p>\n\n<h4>0.9<\/h4>\n\n<p>Added widget for frontend sorting. User testing went on smoothly.<\/p>\n\n<h4>0.8<\/h4>\n\n<p>Initial release. Should work perfectly, but I'll wait for a bit of user testing before calling it 1.0<\/p>","raw_excerpt":"Allows sorting of posts by title, comment count, and other criteria for various pages, including category pages, tag pages, home page, etc.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/10480","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=10480"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gabro"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=10480"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=10480"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=10480"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=10480"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=10480"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=10480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}