Base page fails to recognise Page Templates in subdirectories.
Currently, the CiviCRM base page fails to apply the selected Page Template if that template does not reside in the root directory of the theme. The fallback page.php
template is used instead.
Steps to reproduce
Copy the page.php
template from the active theme into a subdirectory, rename it and replace its header with:
/**
* Template Name: CiviCRM Test
*/
Then select "CiviCRM Test" as the template for the CiviCRM base page.
The template will not be loaded and page.php
will be used instead.
The problem
The code to find the Template "name" $template_name = basename( $template );
is too simplistic.
PR to follow.