Deprecated function used to register widget
-
Running WordPress v5.1.1 running on PHP 7.2.16. Plugin version 2.2.69
I activated the debug log for my site and noticed these PHP Deprecated warnings:Function create_function() is deprecated in /path/to/plugins/photo-gallery/photo-gallery.php on line 725
Function create_function() is deprecated in /path/to/plugins/photo-gallery/photo-gallery.php on line 727
Function create_function() is deprecated in /path/to/plugins/photo-gallery/photo-gallery.php on line 729I suggest this alternative to invoking the register_widget during widgets_init which is compatible with latest PHP engine version:
require_once(WD_BWG_DIR . '/admin/controllers/BWGControllerWidget.php'); add_action('widgets_init', function() { return register_widget("BWGControllerWidget"); } ); require_once(WD_BWG_DIR . '/admin/controllers/BWGControllerWidgetSlideshow.php'); add_action('widgets_init', function() { return register_widget("BWGControllerWidgetSlideshow"); } ); require_once(WD_BWG_DIR . '/admin/controllers/BWGControllerWidgetTags.php'); add_action('widgets_init', function() { return register_widget("BWGControllerWidgetTags"); } );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Deprecated function used to register widget’ is closed to new replies.