Skip to content

Commit

Permalink
Fix template name issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Nov 17, 2024
1 parent 6b404d4 commit a780c71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/Templates/Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ public static function template( $template_name, $code = null, $obj = null, $dep
* @return array The list of templates for the pod template.
*/
public static function get_templates_for_pod_template( $template, $obj = null ): array {
$template_name = trim( preg_replace( '/[^a-zA-Z0-9_\-\/]/', '', $template->get_name() ), ' /-' );
$template_name = $template instanceof Template ? $template->get_name() : ( $template['slug'] ?? $template['name'] );
$template_name = trim( preg_replace( '/[^a-zA-Z0-9_\-\/]/', '', $template_name ), ' /-' );

$default_templates = array(
'pods/templates/' . $template_name . '.php',
Expand Down

0 comments on commit a780c71

Please sign in to comment.