• Getting a deprecation error in PHP 7:

    <b>Deprecated:</b> Methods with the same name as their class will not be constructors in a future version of PHP; RegenerateThumbnails has a deprecated constructor in /path/to/wp/wp-content/plugins/regenerate-thumbnails/regenerate-thumbnails.php on line 31

    It’s easy enough to future-proof: simply renaming the constructor function from RegenerateThumbnails to the correct __construct should make everybody happy. 🙂

    https://wordpress.org/plugins/regenerate-thumbnails/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Please could you guide us on where to make the change. Just learning to make changes to the code. Thank you for your help.

    Thread Starter Alhadis

    (@alhadis)

    Uhm. I said it’s the constructor function, which means line 35 of regenerate-thumbnails.php needs to change from this:

    // Plugin initialization
    function RegenerateThumbnails() {

    Into this:

    // Plugin initialization
    function __construct() {

    Make sense? =)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deprecated constructor call’ is closed to new replies.