Changeset 9165
- Timestamp:
- 11/22/2014 01:49:35 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-classes.php
r9164 r9165 155 155 $this->unread_count = $this->recipients[bp_loggedin_user_id()]->unread_count; 156 156 } 157 158 /** 159 * Fires after a BP_Messages_Thread object has been populated. 160 * 161 * @since BuddyPress (2.2.0) 162 * 163 * @param BP_Messages_Thread Message thread object. 164 */ 165 do_action( 'bp_messages_thread_post_populate', $this ); 157 166 } 158 167 … … 184 193 * @since BuddyPress (1.0.0) 185 194 * 186 * @return object195 * @return array 187 196 */ 188 197 public function get_recipients() { … … 192 201 $results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) ); 193 202 194 foreach ( (array) $results as $recipient ) 203 foreach ( (array) $results as $recipient ) { 195 204 $recipients[$recipient->user_id] = $recipient; 196 197 return $recipients; 205 } 206 207 /** 208 * Filters the recipients of a message thread. 209 * 210 * @since BuddyPress (2.2.0) 211 * 212 * @param array $recipients Array of recipient objects. 213 * @param int $thread_id ID of the current thread. 214 */ 215 return apply_filters( 'bp_messages_thread_get_recipients', $recipients, $this->thread_id ); 198 216 } 199 217 … … 210 228 public static function delete( $thread_id ) { 211 229 global $wpdb, $bp; 230 231 /** 232 * Fires before a message thread is deleted. 233 * 234 * @since BuddyPress (2.2.0) 235 * 236 * @param int $thread_id ID of the thread being deleted. 237 */ 238 do_action( 'bp_messages_thread_before_delete', $thread_id ); 212 239 213 240 // Mark messages as deleted … … 229 256 } 230 257 231 do_action( 'messages_thread_deleted_thread', $message_id ); 258 /** 259 * Fires after a message thread is deleted. 260 * 261 * @since BuddyPress (2.2.0) 262 * 263 * @param int $thread_id ID of the thread being deleted. 264 */ 265 do_action( 'bp_messages_thread_after_delete', $message_id ); 232 266 233 267 return true; … … 295 329 } 296 330 297 return array( 'threads' => &$threads, 'total' => (int) $total_threads ); 331 /** 332 * Filters the results of the query for a user's message threads. 333 * 334 * @since BuddyPress (2.2.0) 335 * 336 * @param array $value { 337 * @type array $threads Array of threads. Passed by reference. 338 * @type int $total_threads Number of threads found by the query. 339 * } 340 */ 341 return apply_filters( 'bp_messages_thread_current_threads', array( 'threads' => &$threads, 'total' => (int) $total_threads ) ); 298 342 } 299 343 … … 418 462 } 419 463 420 return (int) $unread_count; 464 /** 465 * Filters a user's unread message count. 466 * 467 * @since BuddyPress (2.2.0) 468 * 469 * @param int $unread_count Unread message count. 470 * @param int $user_id ID of the user. 471 */ 472 return apply_filters( 'messages_thread_get_inbox_count', (int) $unread_count, $user_id ); 421 473 } 422 474
Note: See TracChangeset
for help on using the changeset viewer.