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/functions.php

    r12616 r12892  
    444444
    445445/**
     446 * Return the raw database count of reviews by a user.
     447 *
     448 * @param int $user_id User ID to get count for.
     449 * @return int Raw DB count of reviews.
     450 */
     451function wporg_support_get_user_report_count( $user_id = 0 ) {
     452    if ( ! class_exists( 'WordPressdotorg\Forums\Plugin' ) ) {
     453        return 0;
     454    }
     455
     456    $plugin_instance = WordPressdotorg\Forums\Plugin::get_instance();
     457
     458    return $plugin_instance->users->get_user_report_count( $user_id );
     459}
     460
     461/**
    446462 * Check if the current page is a single review.
    447463 *
     
    488504function wporg_support_is_single_user_topics_replied_to() {
    489505    return (bool) get_query_var( 'wporg_single_user_topics_replied_to' );
     506}
     507
     508/**
     509 * Check if the current page is a user's "Reports Submitted" page.
     510 *
     511 * @return bool True if the page is a "Reports Submitted" page, false otherwise.
     512 */
     513function wporg_support_is_single_user_reported_topics() {
     514    return (bool) get_query_var( 'wporg_single_user_reported_topics' );
    490515}
    491516
Note: See TracChangeset for help on using the changeset viewer.