WordPress.org

Forums

Relevanssi - A Better Search
[Bug+fix] for when Relevanssi has not been translated to language x (2 posts)

  1. jrf
    Member
    Posted 1 year ago #

    Hi Mikko,

    Here's another small fix:

    File /lib/stopwords.php, line 14-21:

    include($relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang);
    
    	if (is_array($stopwords) && count($stopwords) > 0) {
    		foreach ($stopwords as $word) {
    			$q = $wpdb->prepare("INSERT IGNORE INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", trim($word));
    			$wpdb->query($q);
    		}
    	}

    Replace with:

    if( file_exists( $relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang ) {
    		include($relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang);
    
    		if (is_array($stopwords) && count($stopwords) > 0) {
    			foreach ($stopwords as $word) {
    				$q = $wpdb->prepare("INSERT IGNORE INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", trim($word));
    				$wpdb->query($q);
    			}
    		}
    	}

    Hope this helps & keep up the good work ;-)

    Smile,
    Juliette

    http://wordpress.org/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.