WordPress.org

Making WordPress.org

Changeset 5710


Ignore:
Timestamp:
07/20/2017 08:56:04 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Support Forums: Don't update reply counts when arching or unarchiving a pending or spam post, as the number of hidden replies does not change in that case.

See #1971, #2171.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 edited

Legend:

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

    r5695 r5710  
    114114    /**
    115115     * Update the necessary meta data when editing a topic created before
    116      * 2017-07-17, as those topics can have potentially inaccurate data.
     116     * 2017-07-21, as those topics can have potentially inaccurate data.
    117117     *
    118118     * @see https://meta.trac.wordpress.org/ticket/1971
     
    122122     */
    123123    function update_old_topic_meta( $topic_id ) {
    124         // Only run on topics older than 2017-07-17.
    125         if ( get_post_field( 'post_date', $topic_id ) >= '2017-07-17' ) {
     124        // Only run on topics older than 2017-07-21.
     125        if ( get_post_field( 'post_date', $topic_id ) >= '2017-07-21' ) {
    126126            return;
    127127        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php

    r5688 r5710  
    497497                    bbp_update_topic_voice_count( $topic_id );
    498498
    499                     bbp_decrease_topic_reply_count( $topic_id );
    500                     bbp_increase_topic_reply_count_hidden( $topic_id );
     499                    if ( 'publish' === $post->post_status ) {
     500                        bbp_decrease_topic_reply_count( $topic_id );
     501                        bbp_increase_topic_reply_count_hidden( $topic_id );
     502                    }
    501503                } else {
    502504                    bbp_unstick_topic( $post->ID );
     
    541543                    bbp_update_topic_voice_count( $topic_id );
    542544
    543                     bbp_increase_topic_reply_count( $topic_id );
    544                     bbp_decrease_topic_reply_count_hidden( $topic_id );
     545                    if ( 'publish' === $post_status ) {
     546                        bbp_increase_topic_reply_count( $topic_id );
     547                        bbp_decrease_topic_reply_count_hidden( $topic_id );
     548                    }
    545549                }
    546550
Note: See TracChangeset for help on using the changeset viewer.