Filters the content readers the assistant can use.
A reader receives the object ID and the viewer's user ID and returns array{title: string, url: string, text: string} with plain text, or null when the viewer must not see it. It may add sections, a list of array{heading: string, anchor: string, text: string}, so passages keep their heading and link to it. It is responsible for every visibility check: status, passwords and any membership rule.
Parameters of davo_ai_assistant_source_resolvers
Parameter
Type
Description
$resolvers
array<string, callable>
Search object type => reader. A reader may also return updated_at, the GMT date the content last changed, which is shown to the visitor beside the source.
Filters whether a request to the assistant may proceed.
A challenge such as Cloudflare Turnstile or hCaptcha hooks in here: read its token from the request and return a WP_Error (status 403 is expected) to refuse. Runs before any content is searched and before anything is sent to the AI provider.
src/domains/docs/services/cache.php:194, and 1 more place
Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.