Search by

wpint / wpapi

The Wpint WPAPI package.

Maintainers

Package info

github.com/wpint/wpapi

pkg:composer/wpint/wpapi

Transparency log

Statistics

Installs: 64

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0 2026-08-28 13:13 UTC

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