Skip to content

Admin Pages

Admin Pages are surfaces that render a UI Component as a WordPress admin menu page, accessible from the dashboard sidebar.

How Admin Pages Work

An admin page is a surface that connects:

  1. A WordPress admin menu entry -- appears in the dashboard sidebar under the WP-Nexus section
  2. A UI Component -- the visual layout rendered inside the admin page
  3. A data source pipeline -- runs before the component renders, pre-loading context data

When an administrator clicks the menu item, WP-Nexus executes the surface pipeline and renders the component inside the standard WordPress admin chrome.

Creating an Admin Page

Navigate to your app and click the Admin Pages tab. Click New Admin Page and fill in:

  • Name -- a descriptive name (e.g., "Order Management")
  • Slug -- URL-safe identifier, auto-generated from the name
  • Component -- select the UI Component to render
  • Menu Title -- the label shown in the WordPress admin sidebar (defaults to the name)
  • Capability -- the WordPress capability required to access this page

Capability Options

The capability setting controls who can see and access the admin page. Common capabilities:

CapabilityWho Has It
manage_optionsAdministrators only
edit_postsEditors, Authors, Contributors, Administrators
readAll logged-in users (Subscribers and above)
edit_others_postsEditors and Administrators
manage_categoriesEditors and Administrators

Choose the most restrictive capability that still allows the intended audience to access the page. See the WordPress Roles and Capabilities documentation for the full list.

Data Source Pipeline

Each admin page has its own data source pipeline that runs before the component renders. Use it to pre-load data that the component needs:

Query Table (orders, sort by created_at desc) → Limit (50) → Output

The component then accesses the data via expressions like {{row.order_number}}, {{row.status}}, etc.

Example: Order Management Dashboard

  1. Create an admin page named "Order Management"
  2. Set the capability to manage_options (admins only)
  3. Select your "Orders Dashboard" component
  4. Open the pipeline editor and build:
Query Table (orders, where status != "archived") → Sort (created_at, desc) → Output

The admin page now appears in the WordPress sidebar and shows a live orders dashboard.

TIP

Admin pages are registered during WordPress initialization. They appear as submenu items under the WP-Nexus parent menu in the admin sidebar.