Apologies as the topic has been asked several times, but as a newbie I’d like to ask a specific help on rewriting the code below.
The problem raised when I switched an old site to PHP 7.3 and the WordPress debug file gave the following error:
Function create_function() is deprecated in /data01/virt/domeenid/domain/subdomain/wp-content/themes/org/libs/oi/oi-functions.php on line 31
When checking the file oi-functions.php
line 31 has the following:
$langs = array_map( create_function('$key', '
switch($key["language_code"])
{
case "ru" : $abbr = "RUS"; break;
case "en" : $abbr = "ENG"; break;
case "et" : $abbr = "EST"; break;
case "lt" : $abbr = "LIT"; break;
case "lv" : $abbr = "LAT"; break;
case "de" : $abbr = "GER"; break;
default:
$abbr = $key["language_code"];
break;
}
return array(
"language_code" => $key["language_code"],
"language_abbr" => $abbr,
"native_name" => $key["native_name"],
"url" => $key["url"]
);'
), $langs );
Could someone please help me to resolve the issue with the above code so it starts functioning again?
Thank you in advance!