Ticket #5945: bp-messages-classes-5945.diff
| File bp-messages-classes-5945.diff, 3.0 KB (added by , 11 years ago) |
|---|
-
src/bp-messages/bp-messages-classes.php
268 268 269 269 // No more recipients so delete all messages associated with the thread 270 270 if ( empty( $recipients ) ) { 271 271 272 /** 272 273 * Fires before an entire message thread is deleted. 273 274 * … … 731 732 $this->message = apply_filters( 'messages_message_content_before_save', $this->message, $this->id ); 732 733 $this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id ); 733 734 735 /** 736 * Fires before the current message item gets saved. 737 * 738 * Please use this hook to filter the properties above. Each part will be passed in. 739 * 740 * @since BuddyPress (1.0.0) 741 * 742 * @param BP_Messages_Message Current instance of the message item being saved. Passed by reference. 743 */ 734 744 do_action_ref_array( 'messages_message_before_save', array( &$this ) ); 735 745 736 746 // Make sure we have at least one recipient before sending. … … 770 780 771 781 messages_remove_callback_values(); 772 782 783 /** 784 * Fires after the current message item has been saved. 785 * 786 * @since BuddyPress (1.0.0) 787 * 788 * @param BP_Messages_Message Current instance of the message item being saved. Passed by reference. 789 */ 773 790 do_action_ref_array( 'messages_message_after_save', array( &$this ) ); 774 791 775 792 return $this->id; … … 933 950 $this->subject = apply_filters( 'messages_notice_subject_before_save', $this->subject, $this->id ); 934 951 $this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id ); 935 952 953 /** 954 * Fires before the current message notice item gets saved. 955 * 956 * Please use this hook to filter the properties above. Each part will be passed in. 957 * 958 * @since BuddyPress (1.0.0) 959 * 960 * @param BP_Messages_Notice Current instance of the message notice item being saved. Passed by reference. 961 */ 936 962 do_action_ref_array( 'messages_notice_before_save', array( &$this ) ); 937 963 938 964 if ( empty( $this->id ) ) { … … 954 980 955 981 bp_update_user_last_activity( bp_loggedin_user_id(), bp_core_current_time() ); 956 982 983 /** 984 * Fires after the current message notice item has been saved. 985 * 986 * @since BuddyPress (1.0.0) 987 * 988 * @param BP_Messages_Notice Current instance of the message item being saved. Passed by reference. 989 */ 957 990 do_action_ref_array( 'messages_notice_after_save', array( &$this ) ); 958 991 959 992 return true; … … 993 1026 public function delete() { 994 1027 global $wpdb, $bp; 995 1028 1029 /** 1030 * Fires before the current message item has been deleted. 1031 * 1032 * @since BuddyPress (1.0.0) 1033 * 1034 * @param BP_Messages_Notice Current instance of the message notice item being deleted. 1035 */ 996 1036 do_action( 'messages_notice_before_delete', $this ); 997 1037 998 1038 $sql = $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id );