Making WordPress.org

Changeset 8167


Ignore:
Timestamp:
01/31/2019 07:24:51 PM (8 years ago)
Author:
coffee2code
Message:

Support Forums: Disallow closed support topics from being 'modlook' reported after 6 months.

Props netweb.
Fixes #4132.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-report-topic.php

    r7605 r8167  
    104104                }
    105105
     106                $topic_id = bbp_get_topic_id();
     107
     108                // Disallow closed support topics to be modlook reported after 6 months.
     109                $last_active_post_date = get_post_field( 'post_date', bbp_get_topic_last_active_id( $topic_id ) );
     110
     111                if ( ( time() - strtotime( $last_active_post_date ) ) / MONTH_IN_SECONDS >= 6 ) {
     112                        return;
     113                }
     114
    106115                $current_user     = get_current_user_id();
    107116                $previous_reports = $this->get_previous_reports();
    108                 $is_reported      = has_term( 'modlook', 'topic-tag', bbp_get_topic_id() );
     117                $is_reported      = has_term( 'modlook', 'topic-tag', $topic_id );
    109118
    110119                $report_text = '';
Note: See TracChangeset for help on using the changeset viewer.