If I include a template part within header.php like this:
<?php get_template_part('templates/social-icons'); ?>
Is there a way to retrieve the template name header.php
within this template part? i.e the name of the template which is including social-icons.php
?
So in social-icons.php I want to retrieve the name 'headers.php' dynamically so that I can include social-icons.php elsewhere and react to the name of the calling template.
perhaps something using PHP's get_included_files()
or pathinfo()
?