Skip to main contentSkip to footer

Relevanssi 3.4 was just released. It’s WordPress 4.2 compatible, fixes few small bugs and adds much better meta_query support.

  • New filter: relevanssi_valid_admin_status can be used to adjust post statuses that Relevanssi will handle.
  • If Relevanssi creates an empty excerpt for a post and there’s a user-set excerpt for the post, that excerpt is used.
  • No ellipsis is added to the post excerpt, if the post excerpt shows the whole post.
  • The relevanssi_post_title_before_tokenize filter now has a second parameter that contains the post object.
  • New filter: relevanssi_display_common_words can be used to disable the “25 most common words” listing on the settings page, if it’s too heavy to load.
  • Relevanssi was sanitizing taxonomy titles too aggressively. That is now toned down a bit.
  • Relevanssi now supports post_parent, post_parent__in and post_parent__not_in, though you have to set them in relevanssi_modify_wp_query filter for them to work.
  • Meta query support should now be perfect; there were some limitations with complicated meta queries before.

Your account

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

Search

Popular Resources

Indexing image captions for the posts

…can index it. The image captions for the images in the Media library is stored in the post excerpt, so what needs to be done is to fetch the post excerpts and include them. The actual filter is straightforward: add_filter( ‘relevanssi_content_to_index’, ‘rlv_add_attachment_excerpts’, 10, 2 ); /** * Indexes attachment excerpts……If you want to index the image captions for the posts where the images are used, that’s easy if the captions appear on the page: Relevanssi will index those captions as well as the other text from the post. However, if the captions don’t appear on the page, you need……extra steps in order to read in the captions. The trick is to add an indexing filter on the relevanssi_content_to_index filter hook that will find all the attachments for a post, fetch the desired data out of the attachments and add that data to the parent post content so Relevanssi…

WooCommerce: Searching for orders

….= ‘ ‘ . implode( ‘ ‘, $item_names ); // Total sum of the order. $order_stats = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d”, $post->ID ) ); $content .= ‘ ‘ . $order_stats->total_sales; // Customer first and last name. $customer = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM {$wpdb->prefix}wc_customer_lookup…orders: add_filter( ‘relevanssi_content_to_index’, ‘rlv_index_order_content’, 10, 2 ); function rlv_index_order_content( $content, $post ) { if ( ‘shop_order’ === $post->post_type ) { global $wpdb; // Order number. $content .= ‘ ‘ . $post->ID; // Product names. $item_names = $wpdb->get_col( $wpdb->prepare( “SELECT order_item_name FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d”, $post->ID ) ); $content…Searching for shop orders is tricky with WooCommerce. WooCommerce blocks searching the orders. WooCommerce also keeps the order data in many different tables. Because of this complexity, the shop_order post type is not available for indexing. You can enable it by adding this to your site: add_filter( ‘option_relevanssi_index_post_types’, function( $post_types…

WP e-Commerce
WP e-Commerce is a popular shopping cart plugin for WordPress. This code by Alexander Gieg, added to functions.php for example,…

Related Posts:

Comment Section:

3 Comments. Leave new

  • I updated from 3.3.8 to 3.4 and the search form in the WooCommerce Product Search widget stopped returning results. The products are in the index because they appear when a full search is performed, but not when post_type=product is present. Has anyone else seen the same issue?

    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