How to fix error “Function create_function() working after PHP 7.2 update”

Hi all friend, i have fix error Function create_function() working after PHP 7.2 update when i use plugin Revslider on file functions-wordpress.class.php

Code error

public static function registerWidget($widgetName){
add_action('widgets_init', create_function('', 'return register_widget("'.$widgetName.'");'));
}

and code fix

public static function registerWidget($widgetName){
global $tempWidgetName;
$tempWidgetName=$widgetName;
function register_widget_name($tempWidgetName){
global $tempWidgetName;
return register_widget($tempWidgetName);
}
add_action('widgets_init', 'register_widget_name');

}