Make WordPress Core

Changeset 56697


Ignore:
Timestamp:
09/26/2023 03:52:16 AM (8 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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

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

    r56291 r56697  
    559559}
    560560
     561.community-events .ce-separator::before {
     562    content: "\2022";
     563}
     564
    561565.event-icon {
    562566    height: 18px;
  • 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.