Globals as static class
WordPress using a lot globals variables. These variables are used throughout WordPress code for various reasons. Great example is database connection object wpdb. Here is common
example how to use $wpdb
in some function:
It’s highly uncomfortable and long! Therefore, I have prepared a simple object which make all global variables much more accesible from anywhere: https://gist.github.com/OzzyCzech/4737518 (PHP 5.3+ only)