Skip to:
Content

bbPress.org

Ticket #2652: 2652.diff

File 2652.diff, 1.7 KB (added by netweb, 11 years ago)
  • src/includes/replies/functions.php

     
    785785 * @uses bbp_add_user_subscription() To add the user's subscription
    786786 * @uses bbp_update_reply_forum_id() To update the reply forum id
    787787 * @uses bbp_update_reply_topic_id() To update the reply topic id
     788 * @uses bbp_update_reply_reply_id() To update the reply reply id
    788789 * @uses bbp_update_reply_to() To update the reply to id
    789790 * @uses bbp_update_reply_walker() To update the reply's ancestors' counts
    790791 */
     
    858859        // Reply meta relating to reply position in tree
    859860        bbp_update_reply_forum_id( $reply_id, $forum_id );
    860861        bbp_update_reply_topic_id( $reply_id, $topic_id );
     862        bbp_update_reply_reply_id( $reply_id, $reply_id );
    861863        bbp_update_reply_to      ( $reply_id, $reply_to );
    862864
    863865        // Update associated topic values if this is a new reply
     
    10961098        return apply_filters( 'bbp_update_reply_topic_id', (int) $topic_id, $reply_id );
    10971099}
    10981100
     1101/**
     1102 * Update the reply's reply id
     1103 *
     1104 * @since bbPress (rXXXX)
     1105 *
     1106 * @param int $reply_id Optional. Reply id to update
     1107 * @uses bbp_get_reply_id() To get the reply id
     1108 * @uses update_post_meta() To update the reply's reply id meta
     1109 * @uses apply_filters() Calls 'bbp_update_reply_reply_id' with the reply id
     1110 * @return int Reply id
     1111 */
     1112function bbp_update_reply_reply_id( $reply_id = 0 ) {
     1113
     1114        // Validation
     1115        $reply_id = bbp_get_reply_id( $reply_id );
     1116
     1117        update_post_meta( $reply_id, '_bbp_reply_id', (int) $reply_id );
     1118
     1119        return apply_filters( 'bbp_update_reply_reply_id', (int) $reply_id );
     1120}
     1121
    10991122/*
    11001123 * Update the reply's meta data with its reply to id
    11011124 *