Namespace Roots 8 / Sage

Hey everyone,

I’m trying to understand some of the naming practices in version 8 (sage).

What’s the purpose or goal in moving to using namespaces? Is it safer, does it fit in with Yeoman, or is it just preference?


Funny you ask, we have a new blog post coming up that explains some of the advanced PHP functionality that Sage is incorporating now that the minimum version is PHP 5.4

But the short version is that namespaces are basically the more official version of throwing your theme or plugin name onto every function. So instead of function sage_my_cool_function() {} it can simply become my_cool_function() { } along with the namespace.

Stay tuned for the article :slight_smile:

Ah, I was wondering what these were for. Sounds exciting!