Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function relevanssi_populate_stopwords() {
- global $wpdb, $stopword_table;
- $stopwords_file = 'stopwords';
- if ( defined('WPLANG') ) {
- $tmp_filename = $stopwords_file . '.' . WPLANG;
- if ( file_exists( $tmp_filename ) ) {
- $stopwords_file = $tmp_filename;
- } else {
- if ( strpos( WPLANG, '_' ) > 0 ) {
- $tmp_filename = $stopwords_file . '.' . substr( WPLANG, 0, strpos( WPLANG, '_' ) );
- if ( file_exists( $tmp_filename ) ) {
- $stopwords_file = $tmp_filename;
- }
- }
- }
- }
- include($stopwords_file);
- if (is_array($stopwords) && count($stopwords) > 0) {
- foreach ($stopwords as $word) {
- $q = $wpdb->prepare("INSERT IGNORE INTO $stopword_table (stopword) VALUES (%s)", trim($word));
- $wpdb->query($q);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement