Changeset 5156 for trunk/includes/forums/functions.php
- Timestamp:
- 11/20/2013 07:50:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/functions.php
r5114 r5156 962 962 } 963 963 964 /** Subscriptions *************************************************************/ 965 966 /** 967 * Remove a deleted forum from all users' subscriptions 968 * 969 * @since bbPress (rxxxx) 970 * 971 * @param int $forum_id Get the forum ID to remove 972 * @uses bbp_is_subscriptions_active() To check if the subscriptions are active 973 * @uses bbp_get_forum_id To get the forum id 974 * @uses bbp_get_forum_subscribers() To get the forum subscribers 975 * @uses bbp_remove_user_subscription() To remove the user subscription 976 */ 977 function bbp_remove_forum_from_all_subscriptions( $forum_id = 0 ) { 978 979 // Subscriptions are not active 980 if ( ! bbp_is_subscriptions_active() ) { 981 return; 982 } 983 984 $forum_id = bbp_get_forum_id( $forum_id ); 985 986 // Bail if no forum 987 if ( empty( $forum_id ) ) { 988 return; 989 } 990 991 // Get users 992 $users = (array) bbp_get_forum_subscribers( $forum_id ); 993 994 // Users exist 995 if ( !empty( $users ) ) { 996 997 // Loop through users 998 foreach ( $users as $user ) { 999 1000 // Remove each user 1001 bbp_remove_user_subscription( $user, $forum_id ); 1002 } 1003 } 1004 } 1005 964 1006 /** Count Bumpers *************************************************************/ 965 1007
Note: See TracChangeset
for help on using the changeset viewer.