Get variable value based on string constant

You can do that, but you shouldn’t: Keep the global namespace clean. Each name in the global namespace is a collision candidate. Making a variable global, a constant or a function increases the likelihood of a collision, no matter how good your prefixes are. Constants are the slowest global types. Yes, that’s micro-optimization, but why … Read more

Get WP Install Directory

The WordPress directory path is available in the constant ABSPATH. Be aware this is not related to the wp-content directory. The constant WP_CONTENT_DIR could be set to exactly the same value. Or another directory on the same level where WP_CONTENT_URL is another domain name. There doesn’t even have to be a wp-content equivalent: themes, plugins, … Read more

Constant for ‘barebones’ update of WordPress

So in the old days when WordPress updated you got the whole shebang and deleting Akismet after every time was deadly boring. Things had slightly improved since then (partially driven by minimizing traffic it takes to serve update to everyone), but process also got more complicated. Now there are multiple versions of update archive that … Read more