Support » Plugin: AJAX Thumbnail Rebuild » PHP Deprecated create_function()

  • Resolved audioscavenger

    (@audioscavenger)


    happens with PHP 7.2

    PHP Deprecated: Function create_function() is deprecated in /path/wp-content/plugins/ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php on line 297

    you can easily fix it by replacing line 297

    
    add_action( 'plugins_loaded', create_function( '', 'global $AjaxThumbnailRebuild; $AjaxThumbnailRebuild = new AjaxThumbnailRebuild();' ) );
    

    with

    
    function ajax_thumbnail_rebuild_init() {
      global $AjaxThumbnailRebuild;
      $AjaxThumbnailRebuild = new AjaxThumbnailRebuild();
    }
    add_action( 'plugins_loaded', 'ajax_thumbnail_rebuild_init' );
    

    why did you use a create function for that anyway?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Deprecated create_function()’ is closed to new replies.