Title: constructor method for WP_Widget is deprecated
Last modified: August 30, 2016

---

# constructor method for WP_Widget is deprecated

 *  Resolved [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-8/)
 * Following WordPress 4.3 update:
 * Notice: The called constructor method for WP_Widget is deprecated since version
   4.3.0!
    Use __construct() instead.
 * “If you are sub classing a WordPress class and calling the PHP4 constructor, 
   you should update your code to use parent::__construct instead. You should also
   audit your own code to make sure it is using PHP5 style constructors.”
    [https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/](https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/)
 * “Here is a list of plugins (or rather the WordPress.org slugs for them) recently
   detected…
    [https://gist.github.com/chriscct7/d7d077afb01011b1839d](https://gist.github.com/chriscct7/d7d077afb01011b1839d)“
   Friends don’t let friends use PHP 4 style constructors.”
 * Fixed, I think (‘class-decent-comments-widget.php’):
 *     ```
       /**
       	 * Creates a Decent Comments widget.
       	 */
       	function Decent_Comments_Widget() {
       /*		parent::WP_Widget( false, $name = 'Decent Comments' ); */
       		parent::__construct( false, $name = 'Decent Comments' );
       	}
       ```
   
 * [https://wordpress.org/plugins/decent-comments/](https://wordpress.org/plugins/decent-comments/)

The topic ‘constructor method for WP_Widget is deprecated’ is closed to new replies.

 * ![](https://ps.w.org/decent-comments/assets/icon-256x256.png?rev=1693486)
 * [Decent Comments](https://wordpress.org/plugins/decent-comments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/decent-comments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/decent-comments/)
 * [Active Topics](https://wordpress.org/support/plugin/decent-comments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/decent-comments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/decent-comments/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-8/)
 * Status: resolved