Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

The called constructor method deprecated

$
0
0

Replies: 0

With debugging turned on, upon activating the plugin, this error appears:

“My NOTICE [1024] The called constructor method for WP_Widget in dk_speakout_petition_widget is deprecated since version 4.3.0! Use __construct() instead.”

To fix this error, change line 17 from:
$this->WP_Widget( 'dk_speakout_petition_widget', 'SpeakOut! Email Petitions', $widget_ops );
to use the newer PHP parent constructor, like this:
parent::__construct( 'dk_speakout_petition_widget', __( 'SpeakOut! Email Petitions', 'dk_speakout' ), $widget_ops );

Problem solved. Better debugging should have caught this.

Hope this is fixed in the next release 😀 Had to fix this issue in a few of my own widgets, so this is battle tested.

  • This topic was modified 18 minutes ago by mannweb.

Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>