Skip to:
Content

bbPress.org

Changeset 4490


Ignore:
Timestamp:
11/23/2012 11:30:50 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Extract:

  • Remove extract() from bbp_update_topic_revision_log().
  • See #2056.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/topics/functions.php

    r4443 r4490  
    25562556 */
    25572557function bbp_update_topic_revision_log( $args = '' ) {
    2558     $defaults = array (
     2558
     2559    // Parse arguments with default values
     2560    $r = bbp_parse_args( $args, array(
    25592561        'reason'      => '',
    25602562        'topic_id'    => 0,
    25612563        'author_id'   => 0,
    25622564        'revision_id' => 0
    2563     );
    2564     $r = bbp_parse_args( $args, $defaults, 'update_topic_revision_log' );
    2565     extract( $r );
     2565    ), 'update_topic_revision_log' );
    25662566
    25672567    // Populate the variables
    2568     $reason      = bbp_format_revision_reason( $reason );
    2569     $topic_id    = bbp_get_topic_id( $topic_id );
    2570     $author_id   = bbp_get_user_id ( $author_id, false, true );
    2571     $revision_id = (int) $revision_id;
     2568    $r['reason']      = bbp_format_revision_reason( $r['reason'] );
     2569    $r['topic_id']    = bbp_get_topic_id( $r['topic_id'] );
     2570    $r['author_id']   = bbp_get_user_id ( $r['author_id'], false, true );
     2571    $r['revision_id'] = (int) $r['revision_id'];
    25722572
    25732573    // Get the logs and append the new one to those
    2574     $revision_log               = bbp_get_topic_raw_revision_log( $topic_id );
    2575     $revision_log[$revision_id] = array( 'author' => $author_id, 'reason' => $reason );
     2574    $revision_log                      = bbp_get_topic_raw_revision_log( $r['topic_id'] );
     2575    $revision_log[ $r['revision_id'] ] = array( 'author' => $r['author_id'], 'reason' => $r['reason'] );
    25762576
    25772577    // Finally, update
    2578     return update_post_meta( $topic_id, '_bbp_revision_log', $revision_log );
     2578    return update_post_meta( $r['topic_id'], '_bbp_revision_log', $revision_log );
    25792579}
    25802580
Note: See TracChangeset for help on using the changeset viewer.