WP_Widget errors now in sage

Hi,

I have code for a few custom widgets I have always used with the roots theme. In the previous roots release I always entered the code in lib/extra.php which worked a charm.

However, this is my first time using sage and I keep getting the following error, when I try to even to enter the most simplest widget…

Fatal error: Class ‘Roots\Sage\Extras\WP_Widget’ not found in /Applications/MAMP/htdocs/sage-site/wp-content/themes/sage-theme/lib/extras.php on line 40

Any ideas why this is not working? All my widget structures follow the following sites layout and never gave me problems before…

However I’m not getting passed the first line with WP_Widget.

Regards
a

Use \WP_Widget, or put use WP_Widget; at the top of the file.

See:

http://php.net/manual/en/language.namespaces.faq.php#language.namespaces.faq.shouldicare

Related thread:

https://discourse.roots.io/t/class-roots-sage-wp-query-not-found/2967