I encountered a similar error, where parameters to previous_post_link were ignored. I traced it to the following filters in post-type-order.php:
add_filter('get_previous_post_where', 'cpto_get_previous_post_where', 10, 3);
add_filter('get_previous_post_sort', 'cpto_get_previous_post_sort');
add_filter('get_next_post_where', 'cpto_get_next_post_where', 10, 3);
add_filter('get_next_post_sort', 'cpto_get_next_post_sort');
I added the extra parameters “10, 3”, they are needed to get extra information.
After that the functions “cpto_get_previous_post_where” and “cpto_get_next_post_where” need some fixes to support arrays for $excluded_categories. I copied code from wordpress original ‘get_adjacent_post’ function
if (isset($in_same_cat))
if ( $in_same_cat || !empty($excluded_categories) )
{
$join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
if ( $in_same_cat ) {
if ( ! is_object_in_taxonomy( $post->post_type, 'category' ) )
return '';
$cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids'));
if ( ! $cat_array || is_wp_error( $cat_array ) )
return '';
$join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")";
}
$posts_in_ex_cats_sql = "AND tt.taxonomy = 'category'";
if ( ! empty( $excluded_categories ) ) {
if ( ! is_array( $excluded_categories ) ) {
// back-compat, $excluded_categories used to be IDs separated by " and "
if ( strpos( $excluded_categories, ' and ' ) !== false ) {
_deprecated_argument( __FUNCTION__, '3.3', sprintf( __( 'Use commas instead of %s to separate excluded categories.' ), "'and'" ) );
$excluded_categories = explode( ' and ', $excluded_categories );
} else {
$excluded_categories = explode( ',', $excluded_categories );
}
}
$excluded_categories = array_map( 'intval', $excluded_categories );
if ( ! empty( $cat_array ) ) {
$excluded_categories = array_diff($excluded_categories, $cat_array);
$posts_in_ex_cats_sql = '';
}
if ( !empty($excluded_categories) ) {
$posts_in_ex_cats_sql = " AND tt.taxonomy = 'category' AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')';
}
}
}
I hope that the plugin can be fixed with this information.