Nice! That worked perfectly! Here’s how I added my own blend of custom fields to Relevanssi:
function add_custom_fields_to_relevanssi($post) {
/*
* Do stuff here with the $post object to get your custom field data.
* Convert any terms inside of arrays or serialized objects into a
* string at this time, i.e.:
*
* $custom_fields = array (
* [browsers] => array('chrome', 'safari'),
* [providers] => array('google', 'yahoo'),
* );
*
* should be converted to:
*
* $custom_fields = "chrome, safari, google, yahoo"
*/
// Add your custom field data to $content
$content .= " " . $custom_fields;
// Return the content
return $content;
}
add_filter('relevanssi_content_to_index', 'add_custom_fields_to_relevanssi', 10, 3);