Registering a Dashboard Card

Requires YOOAdmin Extended + Studio Hub.

PHP
add_action( 'yooadmin_dashboard_cards_init', 'myplugin_register_yooadmin_dashboard_card' );

function myplugin_register_yooadmin_dashboard_card(): void { if ( ! function_exists( 'yooadmin_register_dashboard_card' ) ) { return; }

yooadmin_register_dashboard_card( 'myplugin_summary', [ 'title' => __( 'My Plugin', 'myplugin' ), 'description' => __( 'Orders and alerts at a glance.', 'myplugin' ), 'icon' => 'dashicons-chart-area', 'capability' => 'manage_woocommerce', 'placements' => [ 'main', 'aside' ], 'priority' => 20, 'category' => 'My Plugin', 'render' => 'myplugin_render_dashboard_card', 'enqueue' => 'myplugin_enqueue_dashboard_card_assets', ] ); }

See Dashboard Card API Reference for every argument and hook.

Was this article helpful?

Help us improve this article

By submitting this form you agree to our Privacy Policy