Making WordPress.org


Ignore:
Timestamp:
09/17/2023 06:18:29 PM (2 years ago)
Author:
Clorith
Message:

Support Forums: Improved topic report flows.

Where previously, a reported topic would store the report in post meta and be limited to the sidebar view, and any reaction would be secret, unless a moderator contacted reporters publicly, this is no longer the case.

When a report is made, while we maintain the modlook tag as before for compatibility reasons, the report is added as a custom post type entry. This allows for tracking vigilant users who help out a lot, as well as giving us access to valuable data about what kind of reports are being made.

The reports are also presented as "replies" within a topic, giving valuable contextual information to those reviewing reports during the time of the report. This element is also presented in such a way that a moderator is able to respond to a report directly, letting the user view their previous reports and their outcomes within their forum profile, as well as them getting notified of the outcome by email when a topic is handled.

Fixes #5715.

File:
1 edited

Legend:

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

    r10584 r12892  
    9393
    9494        <?php if ( ! $hide_profile_fields && ( $custom_title = get_user_option( 'title', bbp_get_displayed_user_id() ) ) ) : ?>
    95    
     95
    9696            <p class="bbp-user-custom-title"><?php
    9797                /* translators: %s: user's custom title */
    9898                printf( esc_html__( 'Title: %s', 'wporg-forums' ), esc_html( $custom_title ) );
    9999            ?></p>
    100    
     100
    101101        <?php endif; ?>
    102102
    103103        <?php
    104             // Only show the forum role when they're privledged, or the current user is privledged.
    105             if (
    106                 current_user_can( 'moderate' ) ||
    107                 bbpress()->displayed_user->has_cap( bbp_get_moderator_role() ) ||
    108                 bbpress()->displayed_user->has_cap( bbp_get_keymaster_role() )
    109             ) {
    110                 ?><p class="bbp-user-forum-role"><?php
    111                 /* translators: %s: user's forum role */
    112                 printf( esc_html__( 'Forum Role: %s', 'wporg-forums' ), bbp_get_user_display_role() );
    113                 ?></p><?php
    114             }
     104        // Only show the forum role when they're privledged, or the current user is privledged.
     105        if (
     106            current_user_can( 'moderate' ) ||
     107            bbpress()->displayed_user->has_cap( bbp_get_moderator_role() ) ||
     108            bbpress()->displayed_user->has_cap( bbp_get_keymaster_role() )
     109        ) {
     110            ?><p class="bbp-user-forum-role"><?php
     111            /* translators: %s: user's forum role */
     112            printf( esc_html__( 'Forum Role: %s', 'wporg-forums' ), bbp_get_user_display_role() );
     113            ?></p><?php
     114        }
    115115        ?>
    116116
    117117        <?php if ( is_user_logged_in() && ! $hide_profile_fields && ( $website = bbp_get_displayed_user_field( 'user_url' ) ) ) : ?>
    118    
     118
    119119            <p class="bbp-user-website"><?php
    120             /* translators: %s: link to user's website */
    121             printf( esc_html__( 'Website: %s', 'wporg-forums' ), sprintf( '<a href="%s" rel="nofollow ugc">%s</a>', esc_url( $website ), esc_html( $website ) ) );
     120                /* translators: %s: link to user's website */
     121                printf( esc_html__( 'Website: %s', 'wporg-forums' ), sprintf( '<a href="%s" rel="nofollow ugc">%s</a>', esc_url( $website ), esc_html( $website ) ) );
    122122            ?></p>
    123    
     123
    124124        <?php endif; ?>
    125125
     
    145145            ?></p>
    146146        <?php endif; ?>
     147
     148        <?php if ( bbp_is_user_home() || current_user_can( 'moderate' ) ) : ?>
     149            <p class="bbp-user-report-count"><?php
     150                /* translators: %s: number of user's reviews */
     151                printf( esc_html__( 'Reports Submitted: %s', 'wporg-forums' ), number_format_i18n( wporg_support_get_user_report_count() ) );
     152            ?></p>
     153        <?php endif; ?>
    147154    </div>
    148155</div><!-- #bbp-author-topics-started -->
Note: See TracChangeset for help on using the changeset viewer.