Admin
The Admin package provides a React-based interface and supporting PHP for managing T2 blocks and extensions within WordPress. It includes UI components for listing, editing, and organizing blocks and extensions, as well as integration hooks for extending the admin experience.
Structure
-
src/admin.php
Main PHP entry point for registering admin pages and hooks. -
src/app/index.tsx
Main React entry point for the admin UI. -
src/app/components/
item/
– UI for individual block/extension items.list/
– UI for listing blocks/extensions.
-
src/app/style.css
Styles for the admin interface. -
src/app/types.d.ts
TypeScript types for admin components.
Features
- Registers a custom admin page for T2 management.
- React-based UI for listing and managing blocks and extensions.
- Extensible via PHP hooks and filters.
- Modular component structure for easy customization.
Hooks
admin/src/admin.php
T2 Admin Menu Page Title.
This filter allows you to change the title of the T2 admin menu page.
apply_filters( 't2/admin/menu_page/title', string $title )
Parameter | Type | Description |
---|---|---|
$title |
string |
The title of the T2 admin menu page. |
T2 Admin Menu Page Icon.
This filter allows you to change the icon of the T2 admin menu page.
apply_filters( 't2/admin/menu_page/icon', string $icon )
Parameter | Type | Description |
---|---|---|
$icon |
string |
The base64 encoded SVG icon. |
T2 Admin Menu Page Logo
This filter allows you to change the logo of the T2 admin menu page.
apply_filters( 't2/admin/menu_page/logo', string $logo )
Parameter | Type | Description |
---|---|---|
$logo |
string |
The SVG icon. |
Admin JS options
apply_filters( 't2/admin/options', array $options )
Parameter | Type | Description |
---|---|---|
$options |
array |
Dom options. |