• Resolved idowebwork

    (@mannweb)


    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 9 years ago by idowebwork.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author SpeakOut! Steve

    (@123host)

    Thanks for that.

    It isn’t an error as such, it is a warning that (right now) doesn’t affect anything.

    FYI, I took this plugin over after it had been abandoned so there may be all sorts of issues. I haven’t gone through all the code looking for bugs, so I do appreciate hearing about them.

    I have updated the code and will push an upgrade maybe this week when I have a couple of other things sorted out.

    Plugin Author SpeakOut! Steve

    (@123host)

    This is now fixed in version 1.3.0 which will be coming soon

    Hi! I’m having problems with this constructor on line 9.

    “Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dk_speakout_petition_widget has a deprecated constructor in (…)/public_html/plugins/speakout/includes/widget.php on line 9”

    Can you please help?

    Plugin Author SpeakOut! Steve

    (@123host)

    What version of SpeakOut! do you have installed? I fixed this a while back.

    Plugin Author SpeakOut! Steve

    (@123host)

    And what version of php?

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

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