• Hi guys,

    I am quite new here. We recently upgraded our DB from PHP 5.* to 7.
    My site(s) don’t run now. Looks like some constructor issue, but have no idea where / how to fix this. Here is 1 line of many errors:
    Notice: The called constructor method for WP_Widget in LatestBlogWidget is deprecated since version 4.3.0! Use __construct()
    Please help?
    Thanks.

    • This topic was modified 7 years, 11 months ago by heliositswp.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The ability to use PHP 4 style constructors is getting removed from PHP. Without an update, many plugins will eventually no longer work (this is PHP breaking this backwards compatibility, not WordPress)

    Change WP_Widget::WP_Widget() or {object}->WP_Widget() or parent::WP_Widget() to parent::__construct() in your plugin file.

    OR

    You can hide this kind of error by adding this filter in your functions.php

    add_filter(‘deprecated_constructor_trigger_error’, ‘__return_false’);

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you can figure out what plugin is causing the error, make sure you’re using the latest version and, if so, contact its developers about getting it fixed.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Constructor Method Depreciated’ is closed to new replies.