[英]wordpress - how to get an array of templates of an specific theme
I am trying to update a wordpress plugin. 我正在尝试更新wordpress插件。 At current time the plugin code displays:
当前,插件代码显示:
$themes = get_themes();
$theme = get_current_theme();
$templates = $themes[$theme]['Template Files'];
Here the problem is that get_theme()
and get_themes()
are deprecated, and I have tried to change it to wp_get_theme()
, and wp_get_themes()
, but it doesnt work. 这里的问题是,
get_theme()
和get_themes()
,并且我尝试将其更改为wp_get_theme()
和wp_get_themes()
,但是它不起作用。
Does anyone have any idea how to update this? 有人知道如何更新吗? Thanks.
谢谢。
Owww... I found out how it is!!!... 哦,我发现情况如何!
$theme = wp_get_theme();
$templates = $theme->{'Template Files'};
hope it helps somebody else. 希望它对其他人有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.