Tuesday, May 31, 2022
HomeWordPress Developmentwidgets - Newest WordPress has deadly errors in PHP 8.1.6

widgets – Newest WordPress has deadly errors in PHP 8.1.6


/wp-includes/class-wp-widget.php (not a plugin) provides me an error for one weblog, however not the opposite, and each have the identical model of class-wp-widget.php which is senseless to me.

PHP Deadly error: Uncaught ArgumentCountError: Too few arguments to
perform WP_Widget::__construct(), 0 handed in
/dwelling/www/stackexchange.com/wp-includes/class-wp-widget-factory.php on
line 61 and not less than 2 anticipated in
/dwelling/www/stackexchange.com/wp-includes/class-wp-widget.php:162

Studying the code, it seems class-wp-widget.php is the foundation of the issue, however I could possibly be unsuitable.

My different (working) weblog on the identical server has this similar file and I do not get the error, possibly as a result of the working weblog isn’t utilizing widgets. The error seems to be some previous PHP5 constructor that is not appropriate with PHP8. From what I can inform, PHP8 does not have a compatibility mode for older constructor code.

You may see the damaged WordPress perform right here https://developer.wordpress.org/reference/lessons/wp_widget/__construct/

Is there a strategy to “flip off” widgets to deactivate this damaged WordPress code?

PS: I attempted putting in Rector, nevertheless it did not clear up the issue for me.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments