benecaster_ai_search_panel_guest_results
Filters the guests one search finds in the AI Search production panel, with the Guest Manager add-on. Each guest is { id, name, title, organization, matched, profile_url, record_url, appearance_count, appearances }, at most 10, from Guest Manager’s whole roster, so a guest on no published episode yet is listed with appearance_count 0. matched is name, organization, title, bio or episodes (a guest of one of the five best episode results), in that order; appearances lists up to five { id, show_id, show_title, title, date }, newest first; record_url is Guest Manager’s own address for the guest’s record ('' when it gives none). The list is empty when Guest Manager is off on every searched show.
Runs after benecaster_ai_search_panel_results, and the episodes guests come from that filter’s output. Admin only.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$guests |
array |
— | List of `{ id, name, title, organization, matched, profile_url, record_url, appearance_count, appearances }` |
$query |
string |
— | The search, trimmed |
$show_ids |
int[] |
— | The shows searched, each with AI Search switched on |
Returns:
array
Example
// List only guests found by name, not by organization, title or topic.
add_filter( 'benecaster_ai_search_panel_guest_results', function ( array $guests, string $query, array $show_ids ): array {
return array_values( array_filter( $guests, fn( array $g ): bool => 'name' === $g['matched'] ) );
}, 10, 3 );
Notes
A non-array return becomes an empty list. A bio matches by its words (whole words of four letters or more) with every provider, and with OpenAI, Google Gemini or Cohere also by meaning (at most three per search). Walkthrough: Search a podcaster's catalog from the admin, as the AI Search production panel does.
Affects
- GET benecaster-ai-search/v1/panel/search
Need this built rather than just documented? See our services →