• Resolved briarrose29

    (@briarrose29)


    Hi,

    I upgraded to WordPress 4.3 on localhost, and now get the following error:

    Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct()

    (It then lists where the errors are in functions.php, but when I tried editing that file I got a bunch of other errors, such as “Fatal error Cannot redeclare mysql2date() (previously declared in …” so I just reverted back to a copy of the original functions.php file).

    Can someone please let me know how to fix the error notice above?

    Thanks very much for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Setting the WP_DEBUG option back to false did the trick for me in wp-config.php

    … also

    The fix for this is simple, you just need to edit your widget file and change

    $this->WP_Widget( ‘your-widget-id’, __( ‘Widget Display Name’, ‘text-domain’ ), $widget_ops, $control_ops );

    to

    parent::__construct( ‘your-widget-id’, __( ‘Widget Display Name’, ‘text-domain’ ), $widget_ops, $control_ops );

    Thread Starter briarrose29

    (@briarrose29)

    Thanks, yeah I had turned off debug so I didn’t have to look at those error messages, but I’d rather be able to have debug on.

    I found the fix above online also, but where is the widget file?

    Thanks.

    The relevant code can be found 4 (four) times in zerif lite functions.php file.

    Suggested fix for WordPress 4.3 (as also described above):

    Find $this->WP_Widget(

    Replace with parent::__construct(

    PS. This is not yet fixed with 1.8.2.3 released today.

    Alexandra

    (@alexandrastan001)

    Hi,

    You can find the fix in this file and you need to replace it with your existing one: https://github.com/Codeinwp/zerif-lite/blob/development/functions.php

    This issue will be fixed on the next update but that is going to take a while.

    Best regards,
    Alexandra

    @alexandra: FYI, if the whole function.php file is replaced with the linked latest version, a 404 error will happen at every page load as it also enqueues /js/parallax.js file which is not yet included in 1.8.2.3 and earlier.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Update to WordPress 4.3’ is closed to new replies.