Skip to main content

benecaster_ai_search_signed_out_output

Filter Premium ai-search

Filters what a signed-out visitor gets in place of the benecaster_ai_search box when the box is for signed-in visitors only: by default, benecaster_search for the box’s show, Benecaster’s free keyword search. benecaster_ai_search_output is not run then.

Parameters

Name Type Default Description
$html string — The keyword search box for the box's show, or `''` when that shortcode is missing
$atts array — The box's resolved attributes
$show_id int — The box's show

Returns: string

Example

// Invite signed-out visitors to sign in, under the keyword search they get instead.
add_filter( 'benecaster_ai_search_signed_out_output', fn( string $html ): string => $html . '<p><a href="' . esc_url( wp_login_url( get_permalink() ) ) . '">Sign in</a> to search by topic.</p>' );

Notes

Never return markup that calls the AI search route: it refuses a signed-out visitor. Walkthrough: Read, change or log AI Search's search results.

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