I'm having trouble rewriting this line of code that contains create_function() in preparation for updating to PHP 8+.
The line of code to replace is:
add_action('widgets_init', create_function('', 'return register_widget("Ctxt_Menu_Widget");'));
I am trying to replace it with:
$callback = function(){
('', 'return register_widget("Ctxt_Menu_Widget");');
}
add_action('widgets_init', $callback);
But obviously, this isn't right, the replacement code won't allow the array withing that function.
Can someone help me rewrite this? Thanks so much!