Skip to:
Content

bbPress.org

Ticket #3068: 3068.1.hooked_voice_count_update.diff

File 3068.1.hooked_voice_count_update.diff, 2.1 KB (added by thebrandonallen, 8 years ago)
  • src/includes/core/actions.php

    diff --git src/includes/core/actions.php src/includes/core/actions.php
    index 734d00d..1dbf139 100644
    add_action( 'bbp_spam_reply', 'bbp_decrease_user_reply_count' ); 
    309309add_action( 'bbp_insert_topic', 'bbp_insert_topic_update_counts', 10, 2 );
    310310add_action( 'bbp_insert_reply', 'bbp_insert_reply_update_counts', 10, 3 );
    311311
     312// Update topic voice counts.
     313add_action( 'bbp_new_reply',        'bbp_update_topic_voice_count' );
     314add_action( 'bbp_trashed_reply',    'bbp_update_topic_voice_count' );
     315add_action( 'bbp_untrashed_reply',  'bbp_update_topic_voice_count' );
     316add_action( 'bbp_spammed_reply',    'bbp_update_topic_voice_count' );
     317add_action( 'bbp_unspammed_reply',  'bbp_update_topic_voice_count' );
     318add_action( 'bbp_approved_reply',   'bbp_update_topic_voice_count' );
     319add_action( 'bbp_unapproved_reply', 'bbp_update_topic_voice_count' );
     320
     321// Insert reply voice counts.
     322add_action( 'bbp_insert_reply', 'bbp_update_topic_voice_count' );
     323
    312324// Topic status transition helpers for replies
    313325add_action( 'bbp_trash_topic',   'bbp_trash_topic_replies'   );
    314326add_action( 'bbp_untrash_topic', 'bbp_untrash_topic_replies' );
  • src/includes/replies/functions.php

    diff --git src/includes/replies/functions.php src/includes/replies/functions.php
    index 83bca7d..d35286e 100644
    function bbp_update_reply_walker( $reply_id, $last_active_time = '', $forum_id = 
    10221022                                // See https://bbpress.trac.wordpress.org/ticket/2838
    10231023                                bbp_update_topic_last_active_time( $ancestor, $topic_last_active_time );
    10241024
    1025                                 // Always update voice counts
    1026                                 bbp_update_topic_voice_count( $ancestor );
    1027 
    10281025                                // Only update reply count if we're deleting a reply, or in the dashboard.
    10291026                                if ( in_array( current_filter(), array( 'bbp_deleted_reply', 'save_post' ), true ) ) {
    10301027                                        bbp_update_topic_reply_count(        $ancestor );
    10311028                                        bbp_update_topic_reply_count_hidden( $ancestor );
     1029                                        bbp_update_topic_voice_count(        $ancestor );
    10321030                                }
    10331031
    10341032                        // Forum meta relating to most recent topic