Skip to:
Content

bbPress.org

Changeset 6369


Ignore:
Timestamp:
03/07/2017 07:13:52 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Engagements: Move engagement count updates to action hooks.

Props thebrandonallen. Fixes #3068.

Location:
trunk/src/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/actions.php

    r6302 r6369  
    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'   );
  • trunk/src/includes/replies/functions.php

    r6360 r6369  
    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
Note: See TracChangeset for help on using the changeset viewer.