Can I use namespaces in my plugin?
I am building a plugin that I hope to eventually put on Envato CodeCanyon.
Currently I am creating functions of the form mypluginname_action
. This is quickly becoming silly as I have to do that a lot. I'm thinking of using PHP namespaces, but I'm worried that there might be a reason why I shouldn't.
- Are namespaces compatible with WordPress and Envato's coding standards?
- Can I use namespaces in the PHP versions that I should be supporting?
- Are there any professional theme/plugin makers who make use of the namespace feature? If not, why not? Are there any common pitfalls with using namespaces?
I am well aware that I can research all of this myself, and of course I will, but as I'm early in development, at this point I'm hoping for a quick answer from more experienced people who might have already looked into this.
I appreciate any thoughts on this.
Topic coding-standards plugin-development Wordpress
Category Web