(Developer) Managing Themes and Server Environments with Extensible Configuration Arrays

The standard pattern for configuring a server environment and its sites’ themes is to define several constants, set a bunch of global variables, call a few functions, and sprinkle in a few filters into the wp-config.php and functions.php. This methodology to configure WordPress makes it burdensome to allow child themes to override settings in parent themes and for there to be environment-specific configurations across servers, from development to production.

My talk will delve into how we have tackled this problem for large multisite installs by using multidimensional configuration arrays that can be merged and extended before being converted into the constants, global variables, and filters that WordPress relies on. Beyond the increased consistency and convenience of a central configuration registry, we’ll see how using such extensible arrays allows for mixin configurations and “step-parent” themes. We’ll also see how storing all configuration in data arrays (as opposed to code) allows our code to be aware of its larger environment.