WPML
Status
Resolved
Reported for
WPML Multilingual CMS 3.6.3
Resolved in
3.7.0

Overview of the issue

When you update to WPML 3.6.x you might encounter the following error:

PHP Fatal error:  Call to undefined function wp_get_upload_dir() in /public_html/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php on line 316

This error is caused when using an old version of WordPress. The function wp_get_upload_dir() was introduced in WordPress 4.5 version as you can read here

Workaround

This issue will be fixed in the upcoming version of WPML.

As a workaround, use the following steps:


  1. Edit the class-wpml-ls-templates.php file in the ../wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/ folder.

  2. On line 316, replace: $uploads = wp_get_upload_dir();
    with $uploads = wp_upload_dir( null, false );

All known issues →