Motivation
This entire module is designed as a collection of small, static, reusable code snippets organized in final classes. Some of the methods are polyfills (like the Strings::starts_with
and Strings::ends_with
methods which are native to PHP8). Some are WordPress-specific (like the Users::has_roles
) but the most are really PHP-specific. Sometimes they just improve upon existing PHP or WP functions (like Misc::wp_parse_args_recursive
which extends the native wp_parse_args).
Basically a snippet belongs in this module if its logic is universal. It doesn't belong logically to whichever class or trait needs the functionality and its likely to be needed somewhere else as well. It's something we wish existed already either as a PHP or WordPress function.
Last updated