Using Namespacing And Autoloaders In WordPress Plugins

Paulund is full of premium tutorials and support to help with your development

Sign up to get full access to all tutorials.

Get full access for $5/mo

Login to your account


One thing I have been experimenting with recently is adding namespacing and autoloaders to new WordPress plugins. What Are PHP Namespaces PHP namespaces was introduced in version 5.3. Namespaces is a way of grouping classes together into virtual directories, the main reason we would want to do this is to help avoid collision of class names in your application. In PHP you can not define two classes with the same name, if you do this PHP will display a fatal error in your application. Using namespaces means that you can define two classes with the same name . . . This content is restricted to subscribers