Making WordPress.org


Ignore:
Timestamp:
03/21/2017 07:33:38 PM (8 years ago)
Author:
coffee2code
Message:

Support Theme: Display date and time in user profile and moderation admin notices of when a user was flagged.

Props SergeyBiryukov.
Fixes #2584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r5141 r5158  
    310310            $is_user_flagged = WordPressdotorg\Forums\User_Moderation\Plugin::get_instance()->is_user_flagged( get_post()->post_author );
    311311            $moderator       = get_user_meta( get_post()->post_author, WordPressdotorg\Forums\User_Moderation\Plugin::MODERATOR_META, true );
     312            $moderation_date = get_user_meta( get_post()->post_author, WordPressdotorg\Forums\User_Moderation\Plugin::MODERATION_DATE_META, true );
    312313
    313314            if ( $is_user_flagged ) {
    314                 if ( $moderator ) {
     315                if ( $moderator && $moderation_date ) {
     316                    $notices[] = sprintf(
     317                        /* translators: 1: linked moderator's username, 2: moderation date, 3: moderation time */
     318                        __( 'This user has been flagged by %1$s on %2$s.', 'wporg-forums' ),
     319                        sprintf( '<a href="%s">%s</a>', esc_url( home_url( "/users/$moderator/" ) ), $moderator ),
     320                        /* translators: localized date format, see https://secure.php.net/date */
     321                        mysql2date( __( 'F j, Y', 'wporg-forums' ), $moderation_date ),
     322                        /* translators: localized time format, see https://secure.php.net/date */
     323                        mysql2date( __( 'g:i a', 'wporg-forums' ), $moderation_date )
     324                    );
     325                } elseif ( $moderator ) {
    315326                    $notices[] = sprintf(
    316327                        /* translators: %s: linked moderator's username */
Note: See TracChangeset for help on using the changeset viewer.