Filter hook 'dashboard_glance_items'

in WP Core File wp-admin/includes/dashboard.php at line 361

View Source

dashboard_glance_items

Filter Hook
Description
Filters the array of extra elements to list in the 'At a Glance' dashboard widget. Prior to 3.8.0, the widget was named 'Right Now'. Each element is wrapped in list-item tags on output.

Hook Information

File Location wp-admin/includes/dashboard.php View on GitHub
Hook Type Filter
Line Number 361

Hook Parameters

Type Name Description
string[] $items Array of extra 'At a Glance' widget items.

Usage Examples

Basic Usage
<?php
// Hook into dashboard_glance_items
add_filter('dashboard_glance_items', 'my_custom_filter', 10, 1);

function my_custom_filter($items) {
    // Your custom filtering logic here
    return $items;
}

Source Code Context

wp-admin/includes/dashboard.php:361 - How this hook is used in WordPress core
<?php
 356  	 *
 357  	 * @since 3.8.0
 358  	 *
 359  	 * @param string[] $items Array of extra 'At a Glance' widget items.
 360  	 */
 361  	$elements = apply_filters( 'dashboard_glance_items', array() );
 362  
 363  	if ( $elements ) {
 364  		echo '<li>' . implode( "</li>\n<li>", $elements ) . "</li>\n";
 365  	}
 366  

PHP Documentation

<?php
/**
	 * Filters the array of extra elements to list in the 'At a Glance'
	 * dashboard widget.
	 *
	 * Prior to 3.8.0, the widget was named 'Right Now'. Each element
	 * is wrapped in list-item tags on output.
	 *
	 * @since 3.8.0
	 *
	 * @param string[] $items Array of extra 'At a Glance' widget items.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/dashboard.php
Related Hooks

Related hooks will be displayed here in future updates.