Skip to content

Instantly share code, notes, and snippets.

@Kichrum
Last active December 26, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kichrum/7229599 to your computer and use it in GitHub Desktop.
Save Kichrum/7229599 to your computer and use it in GitHub Desktop.
Relevanssi comma separate fix.
diff --git a/wp-content/plugins/relevanssi/lib/common.php b/wp-content/plugins/relevanssi/lib/common.php
index 5ac8d4b..a797aaa 100644
--- a/wp-content/plugins/relevanssi/lib/common.php
+++ b/wp-content/plugins/relevanssi/lib/common.php
@@ -396,7 +396,7 @@ function relevanssi_get_custom_fields() {
return $custom_fields;
}
else {
- $custom_fields = explode(",", $custom_fields);
+ $custom_fields = explode("\n", $custom_fields);
for ($i = 0; $i < count($custom_fields); $i++) {
$custom_fields[$i] = trim($custom_fields[$i]);
}
diff --git a/wp-content/plugins/relevanssi/lib/interface.php b/wp-content/plugins/relevanssi/lib/interface.php
index 8ee8993..530f056 100644
--- a/wp-content/plugins/relevanssi/lib/interface.php
+++ b/wp-content/plugins/relevanssi/lib/interface.php
@@ -1317,8 +1317,9 @@ EOH;
<br /><br />
<label for='relevanssi_index_fields'><?php _e("Custom fields to index:", "relevanssi"); ?>
- <input type='text' name='relevanssi_index_fields' id='relevanssi_index_fields' size='30' value='<?php echo $index_fields ?>' /></label><br />
- <small><?php _e("A comma-separated list of custom fields to include in the index. Set to 'visible' to index all visible custom fields and to 'all' to index all custom fields, also those starting with a '_' character.", "relevanssi"); ?></small>
+ <br />
+ <textarea name='relevanssi_index_fields' id='relevanssi_index_fields' cols='60' rows='9' /><?php echo $index_fields ?></textarea></label><br />
+ <small><?php _e("A list of custom fields to include in the index. Each field from new line. Set to 'visible' to index all visible custom fields and to 'all' to index all custom fields, also those starting with a '_' character.", "relevanssi"); ?></small>
<br /><br />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment