wpint / wpapi
The Wpint WPAPI package.
Requires
- php: ^8.1
- illuminate/support: ^10.0
- wpint/contracts: *
- wpint/support: *
Requires (Dev)
- antecedent/patchwork: ^2.2
- brain/monkey: ^2.6
- mockery/mockery: ^1.6
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-28 13:37:01 UTC
README
A fluent PHP API for registering WordPress hooks, objects, and endpoints — post types, taxonomies, meta boxes, post meta, cron, settings, shortcodes, REST routes, AJAX handlers, script/style enqueueing, sidebars, nav menus, roles, and generic actions/filters — without hand-writing add_action/register_* boilerplate.
composer require wpint/wpapi
How it works
Every object is a chainable builder ending in ->register():
use Wpint\WPAPI\WPAPI; WPAPI::postType() ->name('book') ->public(true) ->hasArchive(true) ->register();
register() defers itself into whatever WordPress lifecycle hook it actually needs (init, admin_init, widgets_init, ...), so it's safe to call at any point during your plugin's bootstrap.
Every security-sensitive default (metabox nonce/capability checks, REST route permission callbacks, AJAX nonce verification, settings sanitizers) is documented per class in Documentation, which has one complete, runnable example for every object.
License
MIT