Skip to main content

benecaster_ai_search_after_panel_search

Action Premium ai-search

Fires after a search from the AI Search production panel, with the results the podcaster is about to receive, after benecaster_ai_search_panel_results. Not fired for a refused request.

Parameters

Name Type Default Description
$query string — The search, trimmed
$show_ids int[] — The shows searched
$results array — The filtered results, each `{ id, show_id, show_title, title, episode_number, season_number, date, excerpt, excerpt_source }`

Example

// Keep a short history of the podcaster's own lookups, for the team's prep notes.
add_action( 'benecaster_ai_search_after_panel_search', function ( string $query, array $show_ids, array $results ): void {
    $log   = (array) get_option( 'my_prep_lookups', [] );
    $log[] = [ 'q' => $query, 'shows' => $show_ids, 'found' => array_column( $results, 'id' ), 'at' => gmdate( 'Y-m-d H:i:s' ) ];
    update_option( 'my_prep_lookups', array_slice( $log, -50 ), false );
}, 10, 3 );

Notes

Affects

  • GET benecaster-ai-search/v1/panel/search

Need this built rather than just documented? See our services →