If you want to change the search results template title “Results for:” to something like “Your Search:”, use gettext_with_context
as it’s a translatable string using context:
function my_text_context_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Results for: %s' :
$translated_text = __( 'Your Search: %s', 'fl-automator' );
break;
}
return $translated_text;
}
add_filter( 'gettext_with_context', 'my_text_context_strings', 20, 3 );
Thanks to @pross for the help.