From 8d27ec48e4ce19ef74a08524d081c94da52cba02 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 26 Sep 2023 03:52:16 +0000 Subject: [PATCH] Administration: Add event type to Events and News widget. Add the event type (WordCamp, Meetup, etc) to the nearby events listing within the Dashboard's Events and News widget. Props renyot, audrasjb, ankit-k-gupta, oglekler, devmuhib, dhruvishah2203, JeffPaul, anveshika, sarahwilliams889, ajakaroth. Fixes #58947. git-svn-id: https://develop.svn.wordpress.org/trunk@56697 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/dashboard.css | 4 ++++ src/wp-admin/includes/dashboard.php | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index c0d2459cac..76270ae0d3 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -558,6 +558,10 @@ display: block; } +.community-events .ce-separator::before { + content: "\2022"; +} + .event-icon { height: 18px; padding-right: 10px; diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index f74b408881..31eba07a2d 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -1454,6 +1454,15 @@ function wp_print_community_events_templates() {
{{ event.title }} + <# if ( event.type ) { + const titleCaseEventType = event.type.replace( + /\w\S*/g, + function ( type ) { return type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); } + ); + #> + {{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }} + + <# } #> {{ event.location.location }}