Recent

crp_relevance_thresholdfilter

crp_relevance_threshold

Filter the minimum share of the strongest candidate’s score that a post must reach.

The strongest score is recalculated for every source post, so the same percentage means the same thing whatever the absolute scores are. Ignored when relevance matching is disabled or on SQLite, where a match is only ever yes or no. Only the setting is part of the cache key, so a filter that varies per request needs caching turned off.

Type: filter
Since: 4.5.0
Source: includes/class-crp-core-query.php line 1178

Parameters

Type Name Description
float $threshold Percentage from 0 to 100. 0 disables the filter.
CRP_Core_Query $instance The CRP_Core_Query instance.

Usage

add_filter( 'crp_relevance_threshold', function($threshold, $instance) {
    // ...
    return $threshold;
} );