Support for WP_Query object
-
Thank you very much for your plugin. It is exactly what I needed. But this plugin only works with query_posts and not with WP_Query Object. See here: https://www.ads-software.com/support/topic/query-posts-8?replies=5 .
As I had a shortcode that used WP_Query Object it didn’t work. But for me the fix was to change 12 lines of code:Line 61-63 (in function ReOrderPostWithinCategory) from:
add_filter('posts_join', array(&$this, 'reOrder_query_join')); add_filter('posts_where', array(&$this, 'reOrder_query_where')); add_filter('posts_orderby', array(&$this, 'reOrder_query_orderby'));
to:
add_filter('posts_join', array(&$this, 'reOrder_query_join'), 10, 2); add_filter('posts_where', array(&$this, 'reOrder_query_where'), 10, 2); add_filter('posts_orderby', array(&$this, 'reOrder_query_orderby'), 10, 2);
Line 67-69 from:
public function reOrder_query_join($args){ global $wpdb,$wp_query;
to:
public function reOrder_query_join($args, $wp_query){ global $wpdb;
Line 91-92 from:
public function reOrder_query_where($args){ global $wpdb,$wp_query;
to:
public function reOrder_query_where($args, $wp_query){ global $wpdb;
And line 115-116 from:
public function reOrder_query_orderby($args){ global $wpdb,$wp_query;
to:
public function reOrder_query_orderby($args, $wp_query){ global $wpdb;
If it doesn’t break anything I suggest you(the author) include the changes here on the WordPress Plugin Directory.
If you have the same problem and the plugin has not been fixed yet just change the mentioned lines (the fix works for plugin version 1.1.6), and it should work.https://www.ads-software.com/plugins/reorder-post-within-categories/
- The topic ‘Support for WP_Query object’ is closed to new replies.