alleyinteractive/wp-type-extensions
A config-driven library from Alley Interactive for registering and extending WordPress custom post types and taxonomies, helping developers define reusable content types, related hooks, and labels more cleanly in themes and plugins.
The v5.0.0 release notes only point at the changelog. Treat that link as required reading before doing anything else: a major version bump on a package that sits close to WordPress registration APIs almost always means renamed/removed methods, changed constructor signatures, or bumped PHP/WordPress minimums. Do not upgrade blindly on a Friday.
Minimal path:
CHANGELOG.md#500 and the diff for composer.json (PHP constraint, WordPress minimum, dependency bumps).composer require alleyinteractive/wp-type-extensions:^5.0 in the WordPress-facing codebase — typically the mu-plugin/plugin layer, or a Laravel service provider that only boots when WordPress is loaded.vendor/autoload.php.init, load the admin, and hit the REST endpoint to confirm nothing regressed.Where to look first in the source:
src/ — these are the day-to-day API surface.First use case: replace a hand-rolled register_post_type() call in an mu-plugin with the package's typed registration class, keep the same slug and capabilities, and verify the editor and REST responses are unchanged. That gives you a safe, reversible migration unit before touching taxonomies, meta, or blocks.
Boot from a service provider, register on init. In a Laravel app that also ships WordPress, keep the package out of the default Laravel boot path. Bind configuration in register(), but defer WordPress-facing work to a dedicated mu-plugin or a provider that checks function_exists( 'register_post_type' ). Register types on init (priority 10 is fine unless you are coordinating with other plugins).
Centralize type definitions. The main value of the package is that post types, taxonomies, meta, and fields are declared as PHP objects instead of scattered arrays. Put those declarations in one place — a WordPress/Types directory or a config array mapped into constructors — so a new post type is one class plus one registration call, not five files.
Keep Laravel config and WP registration separate. Laravel's config/ is great for slugs, labels, and feature flags; WordPress registration is not a Laravel concern. Map config into the type objects at boot, but don't let config:cache become a hidden dependency of init.
Headless pattern. If Laravel is the front end and WordPress is the content back end, register types and meta with show_in_rest => true and explicit auth_callbacks, then consume them in Laravel through HTTP/DTOs. Do not reach into the WP database from Laravel; that coupling is what the typed registration layer is supposed to prevent.
Compose, don't inherit deeply. Use the package's extension points (subclassing a type class, filters on arguments) rather than editing vendor files. If you need a custom field type, wrap it and keep the package class as the inner implementation.
Testing. Unit-test the argument arrays your classes produce without bootstrapping WordPress where possible. For integration, use the WordPress test suite and assert both get_post_type_object() and the REST schema. Add a smoke test that the type appears in show_in_rest — it catches the most common editor breakage.
CI matrix. Run at least the oldest and newest supported PHP and WordPress versions from the v5 changelog. Major releases often drop older PHP; your CI should fail loudly rather than your production site.
^5.0 only after reading the changelog; grep the codebase for any methods/classes listed as removed or renamed. Run static analysis (PHPStan/Psalm) and your test suite before merging.plugins_loaded or at file load produces _doing_it_wrong notices and types that don't appear in the admin. Register on init; if you need to modify another plugin's type, use a later priority.vendor/autoload.php isn't loaded by the mu-plugin. Verify with composer dump-autoload -o and a fresh WP bootstrap.show_in_rest on the post type is not enough for meta; each meta key needs its own registration with a schema and auth callback or the block editor silently drops it.load_plugin_textdomain timing; if labels come through empty or untranslated after the upgrade, check when text domains are loaded relative to init.WP_DEBUG and WP_DEBUG_LOG, and watch for _doing_it_wrong and doing_it_wrong notices. For registration issues, wp post-type list and wp taxonomy list via WP-CLI are faster than clicking around the admin.src/ directory between v4 and v5 — that is usually more accurate than release prose.How can I help you explore Laravel packages today?