Changeset 7627 for trunk/bp-members/bp-members-notifications.php
- Timestamp:
- 11/30/2013 06:39:07 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-notifications.php
r7533 r7627 16 16 /** 17 17 * Add a notification for a specific user, from a specific component 18 * 19 * @deprecated Deprecated since BuddyPress 1.9.0. Use 20 * bp_notifications_add_notification() instead. 18 21 * 19 22 * @since BuddyPress (1.0) … … 33 36 return false; 34 37 } 38 39 // Trigger the deprecated function notice 40 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_add_notification()' ); 35 41 36 42 // Notifications must always have a time … … 54 60 * Delete a specific notification by its ID 55 61 * 62 * @deprecated Deprecated since BuddyPress 1.9.0. Use 63 * bp_notifications_delete_notification() instead. 64 * 56 65 * @since BuddyPress (1.0) 57 66 * @param int $id … … 65 74 } 66 75 76 // Trigger the deprecated function notice 77 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notification()' ); 78 67 79 return BP_Notifications_Notification::delete_by_id( $id ); 68 80 } … … 70 82 /** 71 83 * Get a specific notification by its ID 84 * 85 * @deprecated Deprecated since BuddyPress 1.9.0. Use 86 * bp_notifications_get_notification() instead. 72 87 * 73 88 * @since BuddyPress (1.0) … … 82 97 } 83 98 99 // Trigger the deprecated function notice 100 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notification()' ); 101 84 102 return bp_notifications_get_notification( $id ); 85 103 } … … 87 105 /** 88 106 * Get notifications for a specific user 107 * 108 * @deprecated Deprecated since BuddyPress 1.9.0. Use 109 * bp_notifications_get_notifications_for_user() instead. 89 110 * 90 111 * @since BuddyPress (1.0) … … 101 122 } 102 123 124 // Trigger the deprecated function notice 125 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' ); 126 103 127 $renderable = bp_notifications_get_notifications_for_user( $user_id, $format ); 104 128 … … 114 138 * has visited that component. 115 139 * 140 * @deprecated Deprecated since BuddyPress 1.9.0. Use 141 * bp_notifications_delete_notifications_by_type() instead. 142 * 116 143 * @since BuddyPress (1.0) 117 144 * @param int $user_id … … 126 153 return false; 127 154 } 155 156 // Trigger the deprecated function notice 157 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_type()' ); 128 158 129 159 return bp_notifications_delete_notifications_by_type( $user_id, $component_name, $component_action ); … … 136 166 * has visited that component. 137 167 * 168 * @deprecated Deprecated since BuddyPress 1.9.0. Use 169 * bp_notifications_delete_notifications_by_item_id() instead. 170 * 138 171 * @since BuddyPress (1.0) 139 172 * @param int $user_id … … 149 182 } 150 183 184 // Trigger the deprecated function notice 185 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_item_id()' ); 186 151 187 return bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id ); 152 188 } … … 155 191 * Delete all notifications for by type 156 192 * 193 * @deprecated Deprecated since BuddyPress 1.9.0. Use 194 * bp_notifications_delete_all_notifications_by_type() instead. 195 * 157 196 * @since BuddyPress (1.0) 158 197 * @param int $user_id … … 168 207 } 169 208 209 // Trigger the deprecated function notice 210 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_all_notifications_by_type()' ); 211 170 212 bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id ); 171 213 } … … 176 218 * Used when clearing out all notifications for a user, whene deleted or spammed 177 219 * 220 * @deprecated Deprecated since BuddyPress 1.9.0. Use 221 * bp_notifications_delete_notifications_from_user() instead. 222 * 178 223 * @since BuddyPress (1.0) 179 224 * @param int $user_id … … 189 234 } 190 235 236 // Trigger the deprecated function notice 237 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_from_user()' ); 238 191 239 return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action ); 192 240 } 193 241 194 /** Mark **********************************************************************/195 196 /**197 * Delete notifications for a user by type198 *199 * Used when clearing out notifications for a specific component when the user200 * has visited that component.201 *202 * @since BuddyPress (1.9.0)203 * @param int $user_id204 * @param string $component_name205 * @param string $component_action206 * @param int $is_new207 * @return boolean True on success, false on fail208 */209 function bp_core_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) {210 211 // Bail if notifications is not active212 if ( ! bp_is_active( 'notifications' ) ) {213 return false;214 }215 216 return bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new );217 }218 219 /**220 * Delete notifications for an item ID221 *222 * Used when clearing out notifications for a specific component when the user223 * has visited that component.224 *225 * @since BuddyPress (1.9.0)226 * @param int $user_id227 * @param string $component_name228 * @param string $component_action229 * @param int $is_new230 * @return boolean True on success, false on fail231 */232 function bp_core_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) {233 234 // Bail if notifications is not active235 if ( ! bp_is_active( 'notifications' ) ) {236 return false;237 }238 239 return bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id, $is_new );240 }241 242 /**243 * Mark all notifications read/unread for by type244 *245 * Used when clearing out notifications for an entire component246 *247 * @since BuddyPress (1.9.0)248 * @param int $user_id249 * @param string $component_name250 * @param string $component_action251 * @return boolean True on success, false on fail252 */253 function bp_core_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) {254 255 // Bail if notifications is not active256 if ( ! bp_is_active( 'notifications' ) ) {257 return false;258 }259 260 bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id, $is_new );261 }262 263 /**264 * Mark all notifications read/unread from a user265 *266 * @since BuddyPress (1.9.0)267 * @param int $user_id268 * @param string $component_name269 * @param string $component_action270 * @return boolean True on success, false on fail271 */272 function bp_core_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) {273 274 // Bail if notifications is not active275 if ( ! bp_is_active( 'notifications' ) ) {276 return false;277 }278 279 return bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new );280 }281 282 242 /** Helpers *******************************************************************/ 283 243 … … 287 247 * Used before deleting a notification for a user 288 248 * 249 * @deprecated Deprecated since BuddyPress 1.9.0. Use 250 * bp_notifications_check_notification_access() instead. 251 * 289 252 * @since BuddyPress (1.0) 290 253 * @param int $user_id … … 299 262 } 300 263 264 // Trigger the deprecated function notice 265 _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_check_notification_access()' ); 266 301 267 return bp_notifications_check_notification_access( $user_id, $notification_id ); 302 268 }
Note: See TracChangeset
for help on using the changeset viewer.