deug7
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
I fixed my issue by changing the php version. My website is in php7.4 and my new installation is in php8.2, so some plugins or themes were not compatible.
This part of the file class-wp-widget-factory.php:
sed ‘16,65!d’ /var/www/wordpress/wp-includes/class-wp-widget-factory.php [AllowDynamicProperties]
class WP_Widget_Factory {
/** * Widgets array. * * @since 2.8.0 * @var array */ public $widgets = array(); /** * PHP5 constructor. * * @since 4.3.0 */ public function __construct() { add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); } /** * PHP4 constructor. * * @since 2.8.0 * @deprecated 4.3.0 Use __construct() instead. * * @see WP_Widget_Factory::__construct() */ public function WP_Widget_Factory() { _deprecated_constructor( 'WP_Widget_Factory', '4.3.0' ); self::__construct(); } /** * Registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the$widgetparameter to also accept a WP_Widget instance object * instead of simply aWP_Widgetsubclass name. * * @param string|WP_Widget $widget Either the name of aWP_Widgetsubclass or an instance of aWP_Widgetsubclass. */ public function register( $widget ) { if ( $widget instanceof WP_Widget ) { $this->widgets[ spl_object_hash( $widget ) ] = $widget; } else { $this->widgets[ $widget ] = new $widget(); } }
Viewing 2 replies - 1 through 2 (of 2 total)