PHP 8.1 WP 6.0.3Too few arguments to function WP_Widget::
-
My host update PHP installation from 7.4 to 8.1. I have updated all my themes and plugins, but I have one site which, when 8.1 is applied, will not open. It returns this error message: “0 passed in /home/jaspriv0/public_html/navidad2012/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected”
I am running the NexGen Gallery plug-in which says it is updated (3.3) There is the block widget that’s part of WordPress…otherwise, there are no widgets on the site.
Here are lines 56 – 61 of the file “class-wp-widget-factory.php.”
*/ public function register( $widget ) { if ( $widget instanceof WP_Widget ) { $this->widgets[ spl_object_hash( $widget ) ] = $widget; } else { $this->widgets[ $widget ] = new $widget();
How should I edit this code for compatibility with PHP 8.1 and WP 6.0.3
Any suggestions will be much appreciated – I can toggle from PHP 7.4 to 8.1 for the next 24 hours or so.Thanks for any help offered,
Pedro
- The topic ‘PHP 8.1 WP 6.0.3Too few arguments to function WP_Widget::’ is closed to new replies.