Posted on

CM Tooltip Glossary

A Relevanssi Premium customer bumped into a weird problem with CM Tooltip Glossary (and probably Elementor). Using Elementor, CM Tooltip Glossary and Relevanssi custom excerpts together caused the search results to break in unusual way: each page of the search results showed the same results.

I couldn’t figure out what’s causing this, but it was this particular combo: disabling CM Tooltip Glossary helped, and so did disabling Relevanssi custom excerpts.

In the end, the solution I came up with was to remove all CM Tooltip Glossary filters on the_content with a simple filter function. This does not effect CM Tooltip elsewhere, but removes this problem:

add_action( 'relevanssi_pre_the_content', 'rlv_disable_cmtt_content_filters' );
function rlv_disable_cmtt_content_filters() {
    global $wp_filter;
    foreach ( array_keys( $wp_filter['the_content']->callbacks ) as $priority ) {
    	$wp_filter['the_content']->callbacks[ $priority ] = array_filter( $wp_filter['the_content']->callbacks[ $priority ], function( $key ) {
    		if ( 'CMTT' === substr( $key, 0, 4 ) ) {
    			return false;
    		}
    		return true;
	    }, ARRAY_FILTER_USE_KEY );
    }
}

Add this to the theme functions.php.

2 comments CM Tooltip Glossary

  1. Very interesting. I happen to also be using CM Tooltip Glossary and Relevanssi Premium, latest version of each, and have not encountered that issue – granted, I don’t use Elementor.

Leave a Reply to Yazan Yousef Cancel reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.