[PATCH] Use of deprecated functions "get_themes" and "get_current_theme", v1.3

Home Forums Any Mobile Theme Switcher [PATCH] Use of deprecated functions "get_themes" and "get_current_theme", v1.3

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2859
    Kristoffer LR
    Guest

    diff –git a/any-mobile-theme-switcher.php b/any-mobile-theme-switcher.php
    index c48c645..ff7e4e8 100644
    — a/any-mobile-theme-switcher.php
    +++ b/any-mobile-theme-switcher.php
    @@ -63,7 +63,7 @@ function amts_start(){
    function loadMobileStyle(){
    global $amts_mobile_browser;
    $mobileTheme = $amts_mobile_browser;
    – $themeList = get_themes();
    + $themeList = wp_get_themes();
    foreach ($themeList as $theme) {
    if ($theme[‘Name’] == $mobileTheme) {
    return $theme[‘Stylesheet’];
    @@ -74,7 +74,7 @@ function loadMobileStyle(){
    function loadMobileTheme(){
    global $amts_mobile_browser;
    $mobileTheme = $amts_mobile_browser;
    – $themeList = get_themes();
    + $themeList = wp_get_themes();
    foreach ($themeList as $theme) {
    if ($theme[‘Name’] == $mobileTheme) {
    return $theme[‘Template’];
    diff –git a/includes/amts-theme-select.php b/includes/amts-theme-select.php
    index 69150d4..a01904a 100644
    — a/includes/amts-theme-select.php
    +++ b/includes/amts-theme-select.php
    @@ -9,9 +9,12 @@ $operaTheme = get_option(‘opera_theme’);
    $palmTheme = get_option(‘parm_os_theme’);
    $otherTheme = get_option(‘other_theme’);

    -$themeList = get_themes();
    -$themeNames = array_keys($themeList);
    -$defaultTheme = get_current_theme();
    +$themeList = wp_get_themes();
    +$themeNames = array();
    +foreach ($themeList as $theme_slug => $theme) {
    + $themeNames[] = (string)$theme;
    +}
    +$defaultTheme = (string)wp_get_theme();
    natcasesort($themeNames);
    ?>

Viewing 1 post (of 1 total)
  • The topic ‘[PATCH] Use of deprecated functions "get_themes" and "get_current_theme", v1.3’ is closed to new replies.