diff --git a/template-subtheme.php b/template-subtheme.php index c5f225bdf2ee25b3be49f64a617b06a5df65a5d0..dbd9198b82453f74ffd1a457265cd8bc2ff2e6c7 100644 --- a/template-subtheme.php +++ b/template-subtheme.php @@ -108,10 +108,32 @@ function _zen_default($hook, $variables, $suggestions = array(), $extension = '. } } +/** + * To allow themes to have their own template files, we have to override + * _phptemplate_default() by dynamically defining _phptemplate_HOOK(). + */ +function _zen_hook($hook) { + if (!function_exists("_phptemplate_$hook")) { + // Only create a function if $hook contains letters and underscores. + if (!preg_match('/\W/', $hook)) { + $declaration = <<