Relevanssi runs the filters on the_title using apply_filters(). If your function throws an error when that happens, I’d say there’s something to fix on your function. So, what’s the filter trying to do?
It just adds a small image near the title..
add_filter('the_title', 'newTitle', 10, 2);
function newTitle($title, $id) {
$catImgs="";
if(get_post_type($id)=='post' && are_we_in("the_title"))
{
if ( !is_admin() && in_the_loop() )
{
$catImgs=getTitleImages($id);
}
}
else
if(get_post_type($id)=='page')
{
}
return $catImgs.$title;
}
Hmm… looks like the_title should indeed supply two values, it’s just that most of the time the second isn’t necessary.
If you want a quick fix, adjust your function so that $id has a default value of null and if it is set to null, it gets the global $post id. That should probably fix the issue. Or, you can find this line in lib/indexing.php in Relevanssi:
$titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title));
and change it to:
$titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title, $post->ID));
I’ll fix this in the next version.