Single source of truth
Define resources, capabilities, and schemas in one `wpk.config.ts`. Generators build the rest.
Edit `wpk.config.ts`, run `wpk generate`, then `wpk apply`
Define resources, capabilities, and schemas in one `wpk.config.ts`. Generators build the rest.
`wpk generate` emits PHP controllers, JS hooks, types, and docs; `wpk apply` commits atomically or rolls back.
Declare friendly capability keys once. The CLI validates, injects server checks, and emits a runtime JS map.
Add `ui.admin.dataviews` to get full DataViews admin screens, React, interactivity, access control included.
Building with WPKernel feels less like coding by hand and more like running a precision factory, you design the entire product on a single blueprint (wpk.config.ts). The factory floor (the CLI) then produces every component: PHP, JavaScript, UI, security, to exact specifications through a strict assembly line.
And if that isn't enough and you need something more customised, just build an extension.
This is WPKernel: a meta-framework that brings determinism and predictability to WordPress development, transforming an often-chaotic process into a streamlined and reliable one.
WordPress's flexibility is its strength, but with it comes complexity and maintenance headaches. WPKernel directly addresses these critical pain points:
wpk.config.ts defines your application's intent, and the CLI generates clean, structured code. This eliminates the need for dozens of conflicting plugins and reduces the "spaghetti PHP" often found in custom solutions.Our core architectural discipline is the Actions-First Philosophy. UI components never modify data directly. Instead, they invoke an Action, which acts as a central orchestrator for all write operations. This ensures:
This "Actions-First" approach is a non-negotiable core of WPKernel, providing the guardrails necessary for building truly reliable and maintainable WordPress applications.
# In the wp-content/plugins folder, or develop in isolation using @wordpress/* peer dependencies
npm create @wpkernel/wpk my-plugin
cd my-pluginwpk.config.ts Declare your first resource.
import type { WPKernelConfigV1 } from '@wpkernel/cli/config';
const config: WPKernelConfigV1 = {
version: 1,
namespace: 'MyOrg\\Demo',
resources: {
myPost: {
name: 'myPost', // resource name
routes: {
list: {
path: '/wpk/v1/post',
method: 'GET',
capability: 'post.list', // or anything you want to call it
},
get: {
path: '/wpk/v1/post/:id',
method: 'GET',
capability: 'post.get',
},
create: {
path: '/wpk/v1/post',
method: 'POST',
capability: 'post.create',
},
},
// map each key to a wp cap
capabilities: {
'post.list': 'read',
'post.get': 'read',
'post.create': 'edit_posts',
},
ui: {
admin: {
view: 'dataviews',
dataviews: { search: true },
},
},
},
},
adapters: {},
};
export default config;wpk generate # build PHP controllers, JS hooks, types, and UI shims
wpk apply # transactional write (commit / rollback)Enable your plugin and open its admin screen (it’s already capability-gated.)
What just happened?
wpk.config.ts became REST endpoints, capability enforcement, typed React hooks, and an optional admin UI, all without boilerplate.
WPKernel follows a config-first principle:
apply is transactional, safe to rerun, easy to roll back.