Support » Plugin: Preferred Locale » PHP Fatal error: Call to undefined function wp_get_available_translations()

  • Resolved Chris

    (@eaonflux)


    Hi,

    I like your plug-in but when i try to install all languagepacks i get a fatal error.
    PHP Fatal error: Call to undefined function wp_get_available_translations()

    i solved it by adding this on line 99
    function prefloc_install_locales($new) {
    require_once( ABSPATH . ‘wp-admin/includes/translation-install.php’ );
    if ($new) {
    $available = wp_get_available_translations();
    $installed = wp_get_installed_translations(‘core’)[‘default’];
    $diff = array_diff_key($available, $installed);

    foreach ($diff as $lang)
    wp_download_language_pack($lang[‘language’]);
    }
    }

Viewing 1 replies (of 1 total)
  • Plugin Author Sam Bull

    (@dreamsorcerer)

    Thanks for highlighting that. No idea why that’s needed on your install and not mine, but I’ve updated the plugin.

    If you could upgrade the plugin and double check that everything is working, that would be great.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Fatal error: Call to undefined function wp_get_available_translations()’ is closed to new replies.