Skip to content

Commit a780c71

Browse files
committed
Fix template name issue
1 parent 6b404d4 commit a780c71

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/Templates/Templates.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,8 @@ public static function template( $template_name, $code = null, $obj = null, $dep
738738
* @return array The list of templates for the pod template.
739739
*/
740740
public static function get_templates_for_pod_template( $template, $obj = null ): array {
741-
$template_name = trim( preg_replace( '/[^a-zA-Z0-9_\-\/]/', '', $template->get_name() ), ' /-' );
741+
$template_name = $template instanceof Template ? $template->get_name() : ( $template['slug'] ?? $template['name'] );
742+
$template_name = trim( preg_replace( '/[^a-zA-Z0-9_\-\/]/', '', $template_name ), ' /-' );
742743

743744
$default_templates = array(
744745
'pods/templates/' . $template_name . '.php',

0 commit comments

Comments
 (0)