Changeset 5673
- Timestamp:
- 07/15/2017 11:11:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-dropin.php
r3914 r5673 26 26 remove_action( 'bbp_unapproved_reply', 'bbp_update_reply_walker' ); 27 27 28 add_action( 'bbp_trashed_reply', array( $this, 'bbp_update_reply_walker' ) ); 29 add_action( 'bbp_untrashed_reply', array( $this, 'bbp_update_reply_walker' ) ); 30 add_action( 'bbp_deleted_reply', array( $this, 'bbp_update_reply_walker' ) ); 31 add_action( 'bbp_spammed_reply', array( $this, 'bbp_update_reply_walker' ) ); 32 add_action( 'bbp_unspammed_reply', array( $this, 'bbp_update_reply_walker' ) ); 33 add_action( 'bbp_approved_reply', array( $this, 'bbp_update_reply_walker' ) ); 34 add_action( 'bbp_unapproved_reply', array( $this, 'bbp_update_reply_walker' ) ); 35 28 36 // Avoid bbp_update_topic_walker(). 29 37 remove_action( 'bbp_new_topic', 'bbp_update_topic' ); … … 41 49 remove_filter( 'the_title', 'bbp_get_reply_title_fallback', 2 ); 42 50 } 51 } 52 53 /** 54 * Handle only the necessary meta stuff from trashing/untrashing, deleting, 55 * spamming/unspamming, and approving/unapproving a reply. 56 * 57 * @param int $reply_id Reply ID. 58 */ 59 function bbp_update_reply_walker( $reply_id ) { 60 // Get the topic ID 61 $topic_id = bbp_get_reply_topic_id( $reply_id ); 62 63 // Make every effort to get topic id 64 // https://bbpress.trac.wordpress.org/ticket/2529 65 if ( empty( $topic_id ) && ( current_filter() === 'bbp_deleted_reply' ) ) { 66 $topic_id = get_post_field( 'post_parent', $reply_id ); 67 } 68 69 // Last reply and active ID's 70 bbp_update_topic_last_reply_id( $topic_id ); 71 bbp_update_topic_last_active_id( $topic_id ); 72 73 // Get the last active time 74 bbp_update_topic_last_active_time( $topic_id ); 75 76 // Counts 77 bbp_update_topic_voice_count( $topic_id ); 43 78 } 44 79
Note: See TracChangeset
for help on using the changeset viewer.