Title: dashboard_glance_items
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘dashboard_glance_items’, string[] $items )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#wp--skip-link--target)

Filters the array of extra elements to list in the ‘At a Glance’ dashboard widget.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#description)󠁿

Prior to 3.8.0, the widget was named ‘Right Now’. Each element is wrapped in list-
item tags on output.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#parameters)󠁿

 `$items`string[]

Array of extra ‘At a Glance’ widget items.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#source)󠁿

    ```php
    $elements = apply_filters( 'dashboard_glance_items', array() );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/dashboard.php#L368)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/dashboard.php#L368-L368)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_dashboard_right_now()](https://developer.wordpress.org/reference/functions/wp_dashboard_right_now/)`wp-admin/includes/dashboard.php` |

Dashboard widget that displays some basic stats about the site.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.8.0](https://developer.wordpress.org/reference/since/3.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/?output_format=md#comment-content-4025)
 2.   [Gerald](https://profiles.wordpress.org/gerital/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/#comment-4025)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdashboard_glance_items%2F%23comment-4025)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdashboard_glance_items%2F%23comment-4025)
 4. Add Custom Post Type to ‘At a Glance’ dashboard widget:
 5.     ```php
        function wpdocs_add_custom_post_counts() {
        	$post_types = array( 'wpdocs-project' );
    
        	foreach ( $post_types as $cpt ) {
        		$cpt_info = get_post_type_object( $cpt );
        		$num_posts = wp_count_posts( $cpt );
        		$num = number_format_i18n( $num_posts->publish );
        		$text = _n( $cpt_info->labels->singular_name, $cpt_info->labels->name, intval( $num_posts->publish ) );
    
        		echo '<li class="page-count '. esc_attr( $cpt_info->name ) . '-count"><a href="edit.php?post_type=' . esc_attr( $cpt ) . '">' . $num . ' ' . $text . '</a></li>';
        	}
        }
        add_action( 'dashboard_glance_items', 'wpdocs_add_custom_post_counts' );
        ```
    
 6. The Custom Post Type is shown with the same style as default Posts, Pages and Comments
    use, including number of posts and link to CPT list.
 7.  * This code describes using `dashboard_glance_items` as action – but it is a filter
       and not an action!
     * [Arno Welzel](https://profiles.wordpress.org/awelzel/) [2 years ago](https://developer.wordpress.org/reference/hooks/dashboard_glance_items/#comment-6816)
 8.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdashboard_glance_items%2F%3Freplytocom%3D4025%23feedback-editor-4025)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdashboard_glance_items%2F)
before being able to contribute a note or feedback.