Skip to:
Content

bbPress.org

Changeset 5736


Ignore:
Timestamp:
05/13/2015 12:25:23 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Core: Correct phpdoc to _update_ functions. Also introduce bbp_update_reply_to_id() to help with saving of hierarchical reply metadata. (Will be used in a future commit.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/functions.php

    r5735 r5736  
    7373
    7474/**
    75  * Update a posts forum meta ID
     75 * Update a posts' forum meta ID
    7676 *
    7777 * @since bbPress (r3181)
    7878 *
    79  * @param int $post_id The post to update
     79 * @param int $post_id  The post to update
    8080 * @param int $forum_id The forum
    8181 */
     
    9292
    9393/**
    94  * Update a posts topic meta ID
     94 * Update a posts' topic meta ID
    9595 *
    9696 * @since bbPress (r3181)
    9797 *
    98  * @param int $post_id The post to update
    99  * @param int $topic_id The forum
     98 * @param int $post_id  The post to update
     99 * @param int $topic_id The topic
    100100 */
    101101function bbp_update_topic_id( $post_id, $topic_id ) {
     
    111111
    112112/**
    113  * Update a posts reply meta ID
     113 * Update a posts' reply meta ID
    114114 *
    115115 * @since bbPress (r3181)
    116116 *
    117  * @param int $post_id The post to update
    118  * @param int $reply_id The forum
     117 * @param int $post_id  The post to update
     118 * @param int $reply_id The reply
    119119 */
    120120function bbp_update_reply_id( $post_id, $reply_id ) {
     
    125125    // Update the post meta reply ID
    126126    update_post_meta( $post_id, '_bbp_reply_id', $reply_id );
     127
     128    return $reply_id;
     129}
     130
     131/**
     132 * Update a posts' reply-to meta ID
     133 *
     134 * @since bbPress (r5735)
     135 *
     136 * @param int $post_id  The post to update
     137 * @param int $reply_id The reply ID
     138 */
     139function bbp_update_reply_to_id( $post_id, $reply_id ) {
     140
     141    // Allow the reply ID to be updated 'just in time' before save
     142    $reply_id = (int) apply_filters( 'bbp_update_reply_to_id', $reply_id, $post_id );
     143
     144    // Update the post meta reply ID
     145    update_post_meta( $post_id, '_bbp_reply_to', $reply_id );
    127146
    128147    return $reply_id;
Note: See TracChangeset for help on using the changeset viewer.