So I have a plugin that used to work fine, but for a few days it threw me an error:
PHP Fatal Error: Uncaught Error: Call to undefined function create_function()
After some searching, I found out that this is because create_function()
has been deprecated in PHP 8.
Now the exact line causing the problem is:
$callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
I tried changing it to:
$callback_2 = function(){ ('$matches', return "[" . str_replace("|", "", $matches[1]) . "]";); }
But it doesn't work. So if anyone could point me in the right direction, and I'm new to PHP, that would be great.
try