Dashboard Card API Reference
Card ID rules
- Lowercase letters, numbers, underscore, hyphen (
sanitize_key)
- Globally unique
Registration arguments
| Key | Type | Default | Description |
|---|
title | string | id | Picker title |
description | string | '' | Picker subtitle |
icon | string | dashicons-admin-generic | Dashicons class |
render | callable | required | ( string $card_id, array $card ) — echo HTML |
enqueue | callable | optional | ( string $card_id ) — enqueue assets |
capability | string | read | Minimum capability |
placements | string[] | main, aside | Allowed columns |
priority | int | 10 | Catalog sort (lower first) |
category | string | '' | Picker grouping |
builtin | bool | false | Theme/core — shows Included |
Functions
| Function | Purpose |
|---|
yooadmin_register_dashboard_card( $id, $args ) | Register |
yooadmin_unregister_dashboard_card( $id ) | Remove |
yooadmin_is_dashboard_card( $id ) | Exists check |
yooadmin_get_dashboard_cards() | All registered |
yooadmin_get_dashboard_cards_catalog() | Picker rows |
yooadmin_render_dashboard_card( $id ) | Render HTML |
yooadmin_capture_dashboard_card_assets( $id ) | Styles/scripts for AJAX inject |
Hooks
| Hook | When |
|---|
yooadmin_dashboard_cards_init | Register here (init priority 15) |
yooadmin_register_dashboard_card | Filter args before storage |
yooadmin_dashboard_cards_catalog | Filter picker catalog |
yooadmin_studio_hub_dashboard_widgets_catalog | Studio Hub catalog filter |
yooadmin_dashboard_slug | Filter dashboard page slug |
yooadmin-studio-hub-widget-rendered | JS event after AJAX render |
Render flow
- User adds card from catalog
- Section created with
data-widget-id
- HTML via admin-ajax or REST
yooadmin/v1/studio-hub/widgets/{id}/render
enqueue then render; assets captured for injection
- Client fires
yooadmin-studio-hub-widget-rendered
Built-in sidebar cards cannot be duplicated. Empty render shows: "This dashboard card returned no content."
Support: support@yooadmin.io — subject Studio Hub dashboard card
Was this article helpful?