Skip to:
Content

BuddyPress.org

Ticket #5945: bp-messages-classes-5945.diff

File bp-messages-classes-5945.diff, 3.0 KB (added by tw2113, 6 years ago)
  • src/bp-messages/bp-messages-classes.php

     
    268268
    269269                // No more recipients so delete all messages associated with the thread
    270270                if ( empty( $recipients ) ) {
     271
    271272                        /**
    272273                         * Fires before an entire message thread is deleted.
    273274                         *
     
    731732                $this->message   = apply_filters( 'messages_message_content_before_save',   $this->message,   $this->id );
    732733                $this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id );
    733734
     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                 */
    734744                do_action_ref_array( 'messages_message_before_save', array( &$this ) );
    735745
    736746                // Make sure we have at least one recipient before sending.
     
    770780
    771781                messages_remove_callback_values();
    772782
     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                 */
    773790                do_action_ref_array( 'messages_message_after_save', array( &$this ) );
    774791
    775792                return $this->id;
     
    933950                $this->subject = apply_filters( 'messages_notice_subject_before_save', $this->subject, $this->id );
    934951                $this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id );
    935952
     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                 */
    936962                do_action_ref_array( 'messages_notice_before_save', array( &$this ) );
    937963
    938964                if ( empty( $this->id ) ) {
     
    954980
    955981                bp_update_user_last_activity( bp_loggedin_user_id(), bp_core_current_time() );
    956982
     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                 */
    957990                do_action_ref_array( 'messages_notice_after_save', array( &$this ) );
    958991
    959992                return true;
     
    9931026        public function delete() {
    9941027                global $wpdb, $bp;
    9951028
     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                 */
    9961036                do_action( 'messages_notice_before_delete', $this );
    9971037
    9981038                $sql = $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id );