Changeset 14561
- Timestamp:
- 10/21/2025 07:45:30 AM (41 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
r13539 r14561 79 79 add_filter( 'user_has_cap', array( $this, 'anon_moderator_user_has_cap' ), 10, 4 ); 80 80 add_filter( 'wporg_notifications_pre_notify_matchers', array( $this, 'notify_mod_of_at_mention' ), 10, 2 ); 81 add_filter( 'bbp_add_user_subscription', array( $this, 'replace_moderator_subscriptions' ), 10, 2 ); 81 82 82 83 // Hide reply archives for the @moderator account. … … 1301 1302 return $returnval; 1302 1303 } 1304 1305 /** 1306 * If the @moderator account subscribes to a topic, remove it immediately, and 1307 * subscribe the current user instead. 1308 * 1309 * @param int $user_id The user ID whom was subscribed. 1310 * @param int $object_id The topic ID subscribed to. 1311 */ 1312 public function replace_moderator_subscriptions( $user_id, $topic_id ) { 1313 $moderator_user = get_user_by( 'slug', 'moderator' ); 1314 if ( $moderator_user->ID != $user_id ) { 1315 return; 1316 } 1317 1318 bbp_remove_user_subscription( $moderator_user->ID, $topic_id ); 1319 1320 if ( get_current_user_id() ) { 1321 bbp_add_user_subscription( get_current_user_id(), $topic_id ); 1322 } 1323 } 1303 1324 }
Note: See TracChangeset
for help on using the changeset viewer.