title: Get the name of the current page template from within a plugin without resorting to sniffing the URL
body: <p>I am trying to get the name of the current page template from within a plugin.</p>
  
  <p>I know this is possible, I have seen some plugins that do this. Would I need to include the <code>$wpdb</code> DB and run a custom query? Probably need the <code>$post</code> global as well to get the id. Just curious if there is an easier way.</p>
  
  <p>I have seen posts that use action hooks to accomplish only running a plugin on certain pages, but these clients have a plugin to make their header and want it to be different for certain templates. Kind of a crazy way to accomplish this IMO, but that is where it is.</p>
  
  <p>Right now I am sniffing the URI and search for a string for the particular page, but I would really prefer to make this more modular.</p>