Fix “Notice: The called constructor method for WP_Widget is deprecated” error

November 20, 2015 2:43 pm 0

If you see this error on your WordPress site when debug mode is enabled in WordPress configuration, this means that one or more of your plugins need update.

Thousands of WordPress themes and plugins are affected by this problem since WordPress version 4.3. This problem is caused due to changes in WordPress core in order to keep compatibility with PHP 7. Basically, your site will still work fine, but you will see this notice if debugging is enabled.

Our WordPress themes are not affected with this problem. However, if you are using any of our WordPress plugins that are usually shipped together with our themes, you are probably affected. Fortunately, it’s easy to fix this problem. All you need to do is to open the main plugin file in your favorite plain text editor. In example, if you are using Hot Full Carousel, you should edit file “hot_full_carousel.php”. In this file look for this piece of code:

$this->WP_Widget

Once you found it, simple change it with this code:

parent::__construct

After this, the “Notice: The called constructor method for WP_Widget is deprecated” should disappear from your WordPress site.

If you are using multiple plugins though, it’s possible that you got multiple notices. In this case, using the same method, you should change the piece of code in all plugins.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.