A good overview of namespaces and how they’re helpful for WordPress developers

In the podcast Joe and I just recorded, one of our topics was WordPress PHP version support. In WordPress 5.3, namespaces were introduced, and WordPress core doesn’t use them; but WordPress developers use them often in custom work or for distributed plugins.

WP Shout has an excellent overview of namespaces that really nicely puts namespaces in a context that makes sense to someone that’s really accustomed to WordPress methodologies, like prefixing functions.

Prefixing is what WP Shout calls “poor person’s” namespacing, and has long been common for prefixing procedural code in WordPress. Nacin’s 2010 blog post still holds true today. This guide can take a novice PHP programmerΒ from never hearing what namespacing is to understanding it quite clearly, and maybe other folks with more experience might still pick up a thing or two as well.

Similar Posts