Make WordPress Core


Ignore:
Timestamp:
10/02/2025 09:46:07 PM (6 months ago)
Author:
joedolson
Message:

Privacy: A11y: Show time of privacy request status change.

Add the date and time of privacy request status changes in the privacy requests table. Previously, human_time_diff() was used in the first 24 hours, and only the date after 24 hours. Change the output to display both date and time after 24 hours, using the format used for comments.

Props birgire, desrosj, afercia, xkon, tz-media, garrett-eclipse, sirlouen, sukhendu2002, sajjad67, fakhriaz, joedolson.
Fixes #44267.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php

    r60072 r60891  
    462462
    463463        if ( $timestamp ) {
    464             echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
     464            echo '<span class="status-date">' . $this->get_timestamp_as_date( $timestamp ) . '</span>';
    465465        }
    466466
     
    488488        }
    489489
    490         return date_i18n( get_option( 'date_format' ), $timestamp );
     490        return sprintf(
     491            /* translators: 1: privacy request date format, 2: privacy request time format. */
     492            __( '%1$s at %2$s' ),
     493            /* translators: privacy request date format. See https://www.php.net/manual/en/datetime.format.php */
     494            date_i18n( __( 'Y/m/d' ), $timestamp ),
     495            /* translators: privacy request time format. See https://www.php.net/manual/en/datetime.format.php */
     496            date_i18n( __( 'g:i a' ), $timestamp )
     497        );
    491498    }
    492499
Note: See TracChangeset for help on using the changeset viewer.