Make WordPress Core


Ignore:
Timestamp:
09/26/2023 03:52:16 AM (12 months ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r56599 r56697  
    14551455                    <div class="event-info-inner">
    14561456                        <a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
     1457                        <# if ( event.type ) {
     1458                            const titleCaseEventType = event.type.replace(
     1459                                /\w\S*/g,
     1460                                function ( type ) { return type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); }
     1461                            );
     1462                        #>
     1463                            {{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }}
     1464                            <span class="ce-separator"></span>
     1465                        <# } #>
    14571466                        <span class="event-city">{{ event.location.location }}</span>
    14581467                    </div>
Note: See TracChangeset for help on using the changeset viewer.