[英]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.