In order to keep things clean I use functions.php almost solely to require other files. As such part of functions.php looks like this:
#include types
require("includes/types.php");
#include shortcodes
require("includes/shortcodes.php");
#include widgetareas
require("includes/widgetareas.php");
#include paging navs
require("includes/paging-navs.php");
#include widgets
require("includes/widgets.php");
themefolder/includes/widgets.php looks like this:
/*columns widget*/
require("widgets/columns-widget.php");
And a working widget is written in themefolder/includes/widgets/columns-widget.php
Now here is the strange part: this code doesn’t break or doesn’t throw any errors. Yet the code written in themefolder/includes/widgets.php doesn’t get processed and my columns-widget.php doesn’t load.
On the other hand, if I rename themefolder/includes/widgets.php to themefolder/includes/widget.php and change the corresponding line in functions.php to
#include widgets
require("includes/widget.php");
the code runs as expected and my columns-widget loads.
Why is this? Is this a bug or is it intended behavior?