I currently have a plugin (not a widget) that allows people to use shortcode to put the results on their web pages and posts. Some people have asked for a widget option, so the output can go in the sidebar (if the theme supports it).
Is this possible? I tried putting together a dummy widget (using code from the WP docs), but if I try to activate it like this:
add_action( 'widgets_init', 'src_load_widgets' );
function src_load_widgets() {
register_widget('Foo_Widget');
}
I just get this error:
Fatal error: Class 'Foo_Widget' not found in /Users/me/My Webs/wordpress/wp-includes/widgets.php on line 324
Currently, the widget script is in the same folder as my plugin script since I want to same admin screen as I do for my plugin. Not sure if this is the problem...so basically, I'm a bit lost. Thanks for any help you can provide here.