A drop-in for WordPress sites and themes to make managing collections of data and entities easier. Accessing top-level collections in WordPress are easy, but subsets of those can be more difficult. Collection fixes that.
A Collection is... well, pretty much anything: IDs, colors, keys, text snippets, images... anything in WordPress. I frequently needed to access a subset of posts, pages, products, events, etc., and creating a Collection keeps those subsets readily available. Think of it as a fancy array of data.
- registration via
register_collection()
orCollection::register()
- easily accessible using
get_collection()
orCollection::get()
- implements caching using WordPress cache (within prequest and via transients)
- set lifetime of items easily
- items are directly accessible as an array, iterable, and countable
- searchable
- plenty of actions and filters
- access log (track use)
- duplication detection with
WP_DEBUG