You can get the name from the global $template
. I don’t know of a way to get it with an API call instead of a global, but such is life.
function floridacontent( $content ){
global $template;
$name = basename( $template, '.php' );
if( 'page-florida' == $name ){
$content .= 'Forida added content';
}
return $content;
}
add_filter( 'the_content', 'floridacontent' );