Changeset 11980
- Timestamp:
- 07/20/2022 07:39:18 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-emails.php
r11978 r11980 165 165 $topic_author = bbp_get_reply_author_id( $reply_id ); 166 166 167 // For performance reasons, we've removed the bbPress bbp_update_topic() method, and replaced it with our slightly altered variant. 168 $bbp_update_topic = [ Plugin::get_instance()->dropin, 'bbp_update_topic' ]; 169 if ( ! has_filter( 'bbp_new_topic', $bbp_update_topic ) ) { 170 // Fallback to the default bbPress function if ours isn't present (ie. Rosetta, or when we've successfully removed our performance customizations). 171 $bbp_update_topic = 'bbp_update_topic'; 172 } 173 167 174 // Remove the bbPress topic update handler 168 remove_action( 'bbp_new_topic', 'bbp_update_topic');175 remove_action( 'bbp_new_topic', $bbp_update_topic ); 169 176 170 177 // Call the bbp_new_topic action.. 171 178 do_action( 'bbp_new_topic', $topic_id, $forum_id, array(), $topic_author ); 172 179 173 add_action( 'bbp_new_topic', 'bbp_update_topic', 10, 5 ); // bbPress requests 5, but calls it with 4..180 add_action( 'bbp_new_topic', $bbp_update_topic, 10, 5 ); // bbPress requests 5, but calls it with 4.. 174 181 175 182 delete_post_meta( $topic_id, self::SUBSCRIPTIONS_TRIGGER_KEY ); … … 192 199 } 193 200 194 remove_action( 'bbp_new_reply', 'bbp_update_reply' ); 201 // For performance reasons, we've removed the bbPress bbp_update_reply() method, and replaced it with our slightly altered variant. 202 $bbp_update_reply = [ Plugin::get_instance()->dropin, 'bbp_update_reply' ]; 203 if ( ! has_filter( 'bbp_new_reply', $bbp_update_reply ) ) { 204 // Fallback to the default bbPress function if ours isn't present (ie. Rosetta, or when we've successfully removed our performance customizations). 205 $bbp_update_reply = 'bbp_update_reply'; 206 } 207 208 // Remove the bbPress topic update handler 209 remove_action( 'bbp_new_reply', $bbp_update_reply ); 195 210 196 211 do_action( 'bbp_new_reply', $reply_id, $topic_id, $forum_id, array(), $reply_author, false, false ); 197 212 198 add_action( 'bbp_new_reply', 'bbp_update_reply', 10, 7 );213 add_action( 'bbp_new_reply', $bbp_update_reply, 10, 7 ); 199 214 200 215 delete_post_meta( $reply_id, self::SUBSCRIPTIONS_TRIGGER_KEY );
Note: See TracChangeset
for help on using the changeset viewer.