• Unfortunately the patch provided by ricflomag2 does not work as expected. E.g. the variables $metabox_id and $class are empty when executed in the scope of the anonymous function. A construct like function() use ($class) { ... $x = $class; ... } has to be used to induce variables from the parent scope.

    I’ve uploaded a patched version of file edit-screen.php to Gist. Now the new anonymous functions give the same result as the previous create_function() calls.

    Gist URL: https://gist.github.com/jotazzu/25c20fba42e3dc6c40d80439058a8786

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Another patch: create_function() is deprecated since PHP 7.2’ is closed to new replies.