/wp-includes/class-wp-widget.php gives me an error for one blog, but not the other, and both have the same version of class-wp-widget.php which makes no sense to me.
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /home/www/stackexchange.com/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /home/www/stackexchange.com/wp-includes/class-wp-widget.php:162
Reading the code, it appears class-wp-widget.php is the root of the problem, but I could be wrong.
My other (working) blog on the same server has this same file and I don't get the error.
You can see the broken WordPress function here https://developer.wordpress.org/reference/classes/wp_widget/__construct/
Is there a way to "turn off" widgets to deactivate this broken WordPress code?
Update: thanks @bosco for the idea, looking at the Stack trace helped...
Stack trace:
#0 /home/www/example.com/wp-includes/class-wp-widget-factory.php(61): WP_Widget->__construct()
#1 /home/www/example.com/wp-includes/widgets.php(115): WP_Widget_Factory->register()
#2 /home/www/example.com/wp-content/themes/theme1516/includes/register-widgets.php(22): register_widget()
#3 /home/www/example.com/wp-includes/class-wp-hook.php(307): load_my_widgets()
#4 /home/www/example.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#5 /home/www/example.com/wp-includes/plugin.php(476): WP_Hook->do_action()
#6 /home/www/example.com/wp-includes/widgets.php(1854)
Since "register-widgets.php" is the only non-core code here, and because I assume @bosco's comment is correct, I commented out the old widgets and that at least removed the "white screen of death" meanwhile the homepage looks wonky, will probably just cut/paste the HTML from the PHP 7.x site.
register_widget()
that does not properly override theWP_Widget
constructor.parent::__construct()
when it's supposed to be like thisparent::__construct( 'my_widget', 'My Widget' );