Skip to main contentSkip to footer

Here are the changes in 2.8.2 of Relevanssi Free. These are minor changes, but they can be quite important.

  • WordPress didn’t support searching for multiple categories with the cat query variable. There’s now new cats which can take multiple categories.
  • Similar to cats vs cat, you can use post_types to restrict the search to multiple post types.
  • The order parameter was case sensitive. It isn’t anymore.

Update 25.5.2011: The changelog was incorrect, this is correct.

Update through dashboard or get it from the repository.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

WooCommerce: Searching for orders

…) { $post_types[] = ‘shop_order’; return $post_types; } ); This is not enough, though. The order use custom statuses. You also need to allow these statuses with this code snippet: add_filter( ‘relevanssi_valid_status’, ‘rlv_add_status’ ); add_filter( ‘relevanssi_valid_admin_status’, ‘rlv_add_status’ ); function rlv_add_status( $status_array ) { $status_array[] = ‘wc-completed’; $status_array[] = ‘wc-pending’; return…$status_array; } Now the orders are available in the Relevanssi admin search. They are still excluded from the front end search. Relevanssi indexes very little information about the order by default. You only get the order date. WooCommerce stores the items in the order in wp_woocommerce_order_items. Some stats about the…

Related Posts:

Currently there are no related posts available.

Comment Section:

2 Comments. Leave new

  • Well, of course, right after posting this, I figured it out. If anyone stumbles on this, here’s the solution.

    Relevanssi is expecting a comma separated string, but this gives an array, hence the explode not working on said array. We just need to add a little filter to implode them before relevanssi explodes them. (** this should be a check in the relevanssi code though **).

    function category_implode_query($query) {
    // The query expects a string of ids, but we get an array. Lets implode it.
    if(isset($query->query_vars[‘cats’]) && is_array($query->query_vars[‘cats’])){
    $query->query_vars[‘cats’] = implode(“,”, $query->query_vars[‘cats’]);
    }
    return $query;
    }
    add_filter(‘relevanssi_modify_wp_query’, ‘category_implode_query’);

    Reply
  • Hi! I’m trying to do just this, using checkboxes in my search form to select categories I’d like to search in. Unfortunately, I’m getting an error from your code and I can’t understand why.

    Warning: explode() expects parameter 2 to be string, array given in /wp-content/plugins/relevanssi/lib/search.php on line 930

    cat1
    cat2
    cat3
    cat4
    cat5
    cat6
    cat7

    Any idea why this isn’t working?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed