[英]wordpress - how to get an array of templates of an specific theme
我正在尝试更新wordpress插件。 当前,插件代码显示:
$themes = get_themes();
$theme = get_current_theme();
$templates = $themes[$theme]['Template Files'];
这里的问题是, get_theme()
和get_themes()
,并且我尝试将其更改为wp_get_theme()
和wp_get_themes()
,但是它不起作用。
有人知道如何更新吗? 谢谢。
哦,我发现情况如何!
$theme = wp_get_theme();
$templates = $theme->{'Template Files'};
希望它对其他人有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.