Quantcast
Channel: Topic Tag: error | WordPress.org
Viewing all articles
Browse latest Browse all 31588

useStrict on "Custom Dashboard RSS Feed Strict Error"

$
0
0

I've recently added a custom RSS feed dashboard widget to one of my plugins and I see the following Strict message:

call_user_func_array() expects parameter 1 to be a valid callback, non-static method WP_Feed_Cache::create() should not be called statically on line 215 in file /path/to/wp-includes/SimplePie/Registry.php

The offending call is:

wp_add_dashboard_widget( $widget_id, // widget slug
     $this->widget_options[$widget_id]['title'], // title
     array(&$this, 'whats_new_rss'), // display function
     array(&$this, 'whats_new_rss_control') // control function
 );

public function whats_new_rss()
{
    $widgets = $this->get_widget_options();
    $value = @$widgets[self::WHATS_NEW_RSS_ID];

    echo '<div class="rss-widget">';
    wp_widget_rss_output( $widgets[self::WHATS_NEW_RSS_ID] );
    echo "</div>";
}

If I comment out wp_widget_rss_output() the message stops showing (and of course I don't get my RSS output).

Why does this happen with my call but not with the core dashboard RSS widgets?

Cheers,
Vinny


Viewing all articles
Browse latest Browse all 31588

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>