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
This commit is contained in:
Peter Wilson 2023-09-26 03:52:16 +00:00
parent 9a4511ac94
commit 8d27ec48e4
2 changed files with 13 additions and 0 deletions

View File

@ -558,6 +558,10 @@
display: block;
}
.community-events .ce-separator::before {
content: "\2022";
}
.event-icon {
height: 18px;
padding-right: 10px;

View File

@ -1454,6 +1454,15 @@ function wp_print_community_events_templates() {
<div class="dashicons event-icon" aria-hidden="true"></div>
<div class="event-info-inner">
<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
<# 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 }}
<span class="ce-separator"></span>
<# } #>
<span class="event-city">{{ event.location.location }}</span>
</div>
</div>