Support » Plugin: Youtube Channel Gallery » create_function() is deprecated in PHP 7.2

  • Ulrich



    I get the following PHP notice when running version 2.4 of the plugin.

    PHP Deprecated: Function create_function() is deprecated in /youtube-channel-gallery/youtube-channel-gallery.php on line 1223

    This can be fixed by using anonymous functions instead. Anonymous functions are supported as of PHP 5.3+.

    add_action( 'widgets_init', function() {
    	register_widget( 'YoutubeChannelGallery_Widget' );
    } );

    As WordPress has increased the minimum version 5.6 it is viable to increase the minimum version of the plugin too.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for this, it works. Hope they include it in the next plugin version.

    Speaking of “next plugin version”: This plugin seems to be abandoned. Can the author provide an update and fix the bug mentioned above? I love this plugin and really do not want to switch… 🙁

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘create_function() is deprecated in PHP 7.2’ is closed to new replies.