2012-09-05 22 views
1

我想更新wordpress插件。在當前時間的插件代碼顯示:wordpress - 如何獲取特定主題的模板數組

$themes = get_themes(); 
$theme = get_current_theme(); 
$templates = $themes[$theme]['Template Files']; 

這裏的問題是,get_theme()get_themes()被棄用,我試圖將其更改爲wp_get_theme(),並wp_get_themes(),但它不工作。

有沒有人有任何想法如何更新? 謝謝。

回答

1

Owww ......我發現它是如何!!! ...

$theme = wp_get_theme(); 
    $templates = $theme->{'Template Files'}; 

希望它可以幫助別人。

+1

只是指出''主題= wp_get_themes();'不適用於你的情況。 – Christian

相關問題