You could do something like this to see where it was called from:
add_filter("get_the_archive_title", function($val) {
$backtrace = debug_backtrace();
foreach($backtrace as $level) {
if(array_key_exists("file", $level) && preg_match("!that-file\.php$!", $level["file"]) && array_key_exists("function", $level) && $level["function"] == "get_the_archive_title" ) {
return "works: $val";
}
}
return "test: $val";
}, 10, 1);
You’ll have to adapt the regexp (“that-file.php”) to your needs, and potentially check for another function if it’s not done with get_the_archive_title()
.