zweisteindesign
Forum Replies Created
-
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Search for 2 characters does not workOh man! Thank you so much! I don’t know how I could have missed that.
Of course it works now ??
Forum: Plugins
In reply to: [Relevanssi - A Better Search] post__in argument to get assigned post objectThat was the answer from support. Hope that helps you.
I found an issue with relevanssi plugin regarding to the post__in and post__not_in parameters.
We used both of post__in and post__not_in params in our query.
But your plugin ignored post__in parameter when post__not_in is provided.
Here is your plugin code about this (/lib/search.php line 1059~1071).
$post_query = array(); if ( isset( $query->query_vars['p'] ) && $query->query_vars['p'] ) { $post_query = array( 'in' => array( $query->query_vars['p'] ) ); } if ( isset( $query->query_vars['page_id'] ) && $query->query_vars['page_id'] ) { $post_query = array( 'in' => array( $query->query_vars['page_id'] ) ); } if ( isset( $query->query_vars['post__in'] ) && is_array( $query->query_vars['post__in'] ) && ! empty( $query->query_vars['post__in'] ) ) { $post_query = array( 'in' => $query->query_vars['post__in'] ); } if ( isset( $query->query_vars['post__not_in'] ) && is_array( $query->query_vars['post__not_in'] ) && ! empty( $query->query_vars['post__not_in'] ) ) { $post_query = array( 'not in' => $query->query_vars['post__not_in'] ); }
As you can see if post__not_in is provided, $post_query has changed to have “not in” variable only.
If I change line 1070 like the following, it works.
// $post_query = array( 'not in' => $query->query_vars['post__not_in'] ); $post_query['not in'] = $query->query_vars['post__not_in'];
Please check this and hope you fix it on your side.
And this issue is same for $parent_query as well.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] post__in argument to get assigned post objectWe are trying to make our plugin to compatible with relevanssi, because there are some customers are using Relevanssi with our plugin.
So, we added “relevanssi” parameter as “true” in arguments of query_posts.
Also added the relevanssi_search_ok hook and returns true.
But what I want to know is that why post__in arguments is not working with relevanssi plugin.
Please let us know how to solve this problem with relevanssi compatibility.