Changeset 11533 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
- Timestamp:
- 02/09/2022 01:20:09 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
r11530 r11533 248 248 249 249 // Replace forum subscriber list with term subscribers, avoiding duplicates. 250 add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers _to_forum' ) );250 add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers' ) ); 251 251 252 252 // Actually notify our term subscribers. … … 254 254 255 255 // Remove filters. 256 remove_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers _to_forum' ) );256 remove_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers' ) ); 257 257 remove_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10 ); 258 258 … … 262 262 * Temporarily replace the forum subscriber list with any unincluded term subscribers. 263 263 */ 264 public function add_term_subscribers _to_forum( $users ) {264 public function add_term_subscribers( $users ) { 265 265 return array_diff( $this->subscribers, $users ); 266 266 } … … 369 369 370 370 // Replace forum subscriber list with term subscribers, avoiding duplicates. 371 add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers _to_topic' ) );371 add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) ); 372 372 373 373 // Actually notify our term subscribers. … … 375 375 376 376 // Remove filters. 377 remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers _to_topic' ) );377 remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) ); 378 378 remove_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ) ); 379 }380 381 /**382 * Temporarily replace the forum subscriber list with any unincluded term subscribers.383 */384 public function add_term_subscribers_to_topic( $users ) {385 return array_diff( $this->subscribers, $users );386 379 } 387 380 … … 566 559 * @return bool False if invalid, otherwise true 567 560 */ 568 public static function add_user_subscription( $user_id = 0, $term_id = 0) {561 public static function add_user_subscription( $user_id, $term_id ) { 569 562 if ( empty( $user_id ) || empty( $term_id ) ) { 570 563 return false; … … 575 568 wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' ); 576 569 } 570 577 571 do_action( 'wporg_bbp_add_user_term_subscription', $user_id, $term_id ); 578 572 … … 587 581 * @return bool False if invalid, otherwise true 588 582 */ 589 public static function remove_user_subscription( $user_id = 0, $term_id = 0) {583 public static function remove_user_subscription( $user_id, $term_id ) { 590 584 if ( empty( $user_id ) || empty( $term_id ) ) { 591 585 return false; … … 596 590 wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' ); 597 591 } 592 598 593 do_action( 'wporg_bbp_remove_user_term_subscription', $user_id, $term_id ); 599 594
Note: See TracChangeset
for help on using the changeset viewer.