“Undefined array key” when using relevanssi_orderby filter w post order plugin

Relevanssi works as-is with the post ordering plugin I’m using (Real Custom Post Order) but the results are out of order. So I add the following filter as per the docs:

add_filter( 'relevanssi_orderby', function( $orderby ) {
	$orderby = 'relevance';
	return $orderby;
} );

This fixes the post order, but at the top of the page it outputs:

Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386
Warning: Undefined array key -1 in /Users/me/Local Sites/sitename/app/public/wp-content/plugins/relevanssi/lib/sorting.php on line 386

If I remove the filter the warnings go away, and if I disable Real Custom Post Order the warnings goes away. I know the issue may be with the post ordering plugin, but I’m wondering if you have any advice here. Thanks!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer