Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions src/wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,36 @@ function wp_dashboard_right_now() {
* is wrapped in list-item tags on output.
*
* @since 3.8.0
* @since 7.1.0 Added support for an array of items with `class` and `content` keys.
*
* @param string[] $items Array of extra 'At a Glance' widget items.
* @param string[]|array[] $items Array of extra 'At a Glance' widget items.
* If an array, each element should be an array with
* `class` and `content` keys.
*/
$elements = apply_filters( 'dashboard_glance_items', array() );

if ( $elements ) {
echo '<li>' . implode( "</li>\n<li>", $elements ) . "</li>\n";
foreach ( (array) $elements as $element ) {
if ( is_array( $element ) ) {
printf( "<li class='%s'>%s</li>\n", esc_attr( $element['class'] ), $element['content'] );
} else {
echo '<li>' . $element . "</li>\n";
}
}

?>
</ul>
<?php

/**
* Fires immediately after the 'At a Glance' dashboard widget items list.
*
* Allows developers to add additional lists or separators below the primary
* 'At a Glance' list before the version and privacy information.
*
* @since 7.1.0
*/
do_action( 'dashboard_glance_items_after' );

update_right_now_message();

// Check if search engines are asked not to index this site.
Expand Down
Loading