PSR-4 autoloading is triggered by a class name PHP cannot resolve. Functions and constants have no such hook, so a helpers file has to be loaded eagerly —…
Registering a custom post type does not create its rewrite rules, so the archive 404s until permalinks are re-saved. The fix that circulates is flush_rewrite_rules() on init, which…
Before 5.6, a constant or a default parameter value had to be a literal. Anything computed — even multiplying two numbers you had already defined — was a…
A repository wrapping a single ORM, forwarding find to find, is indirection with nothing behind it — the abstraction has one implementation and will never have another, and…
Collecting a variable number of arguments used to mean func_get_args(), which hides the signature from anyone reading the function and from every IDE. 5.6 gives the language a…
In multisite, switch_to_blog() repoints the database tables and the uploads path. It does not reload the other site’s active plugins, its theme, or anything a plugin cached in…
A WooCommerce product is a post, so get_post() returns something usable and the price is right there in the meta. It is also wrong for variable products, where…
Two hundred and forty require_once calls where load order was load-bearing, moved onto an autoloader one namespace at a time without a big-bang rewrite.