wp_dashboard_widgets
Filters the list of widgets to load for the admin dashboard.
Usage
add_filter( 'wp_dashboard_widgets', 'wp_kama_dashboard_widgets_filter' ); /** * Function for `wp_dashboard_widgets` filter-hook. * * @param string[] $dashboard_widgets An array of dashboard widget IDs. * * @return string[] */ function wp_kama_dashboard_widgets_filter( $dashboard_widgets ){ // filter... return $dashboard_widgets; }
- $dashboard_widgets(string[])
- An array of dashboard widget IDs.
Changelog
Since 2.5.0 | Introduced. |
Where the hook is called
wp_dashboard_widgets
wp-admin/includes/dashboard.php 144
$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );