I'm trying to maintain compatibility of a crucial WordPress plugin (jQuery Vertical Accordion Menu) on my site.
There's one line in the plugin code that breaks the site with PHP 8.0:
add_action('widgets_init', create_function('', 'return register_widget("dc_jqaccordion_widget");'));
The problem is that the create_function()
method has been removed from PHP 8.0 due to it being based on the eval()
function which has security issues. Apparently, there's a way to rewrite this line to use an anonymous function instead of calling create_function()
, but I don't know PHP.
How can I re-write this line to maintain functionality, but avoid using the create_function
method?