• Resolved eiland

    (@eiland)


    In line 751 in better-rss-widget.php the deprecated function create_function is being used:

    add_action('widgets_init', create_function('', 'return register_widget("better_rss_widget");'));

    • This topic was modified 2 years, 3 months ago by eiland.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You can replace it, with the following.
    add_action( 'widgets_init', function() { register_widget("better_rss_widget"); } );

    Also change in line ~60 the
    parent::WP_Widget(false, $this->pluginName, $widget_ops, $control_ops); with the
    parent::__construct($this->pluginName, $this->pluginName, $widget_ops, $control_ops);

    Bests,
    Lena

    Thread Starter eiland

    (@eiland)

    Super, thanks!

    @lenasterg Are you still using this? I’m glad I’m not the only one. I have been worried about security risks and compatibility for years. This plug-in is so much nicer than the default RSS widget.

    @lenasterg Still getting Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /path-to/wp/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /path-to/wp/wp-includes/class-wp-widget.php:162

    Any ideas?

    Hi @ssarama.
    Try to change the line with the following:
    parent::__construct($this->pluginName, $this->pluginName, $widget_ops, $control_ops);

    Plugin Author GrandSlambert

    (@grandslambert)

    I have just updated the plugin to get rid of the error and make it work in the latest version of WordPress and the latest PHP. I will be updating it more soon.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Deprecated funtion in php8’ is closed to new replies.