If you are unaware, in many cases the files of your plugin and theme will be run in function scope. If you are expecting that your code is being included in the global scope and your code works that way, then you’ll be caught with a surprise when bug reports creep up about the plugin not working correctly. The problem will persist as the WordPress versions continue to “encapsulate” the plugin and theme code.
The best way to get around it is to always use functions and have all of your code loaded that way. This shouldn’t be a major problem with themes, since the WordPress environment is included in with the functions (not always for plugins when activating). Most themes shouldn’t rely on the non-WordPress globals. I fear that more WordPress theme frameworks will and the problem might be found in those so called frameworks as well.
Possibly Related Posts:
- What I’ve Learned From WordPress
- Why Do I Feel Like an Asshole When Criticizing WordPress?
- PHP5 Straw Man Argument
- WordPress 2.7 Changes Class for Plugins
- Web Application Versioning Alpha Release
Comments are closed.