MariaZ
MariaZ

Reputation: 1747

wordpress - how to get an array of templates of an specific theme

I am trying to update a wordpress plugin. 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.

Does anyone have any idea how to update this? Thanks.

Upvotes: 1

Views: 306

Answers (1)

MariaZ
MariaZ

Reputation: 1747

Owww... I found out how it is!!!...

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

hope it helps somebody else.

Upvotes: 2

Related Questions