簡體   English   中英

wordpress-如何獲取特定主題的模板數組

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM