Skip to:
Content

bbPress.org

Changeset 4486


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

Extract:

  • Remove extract() from bbp_update_reply_revision_log().
  • Other general code cleanup.
  • See #2056.
File:
1 edited

Legend:

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

    r4427 r4486  
    987987 */
    988988function bbp_update_reply_revision_log( $args = '' ) {
    989     $defaults = array (
     989
     990    // Parse arguments with default values
     991    $r = bbp_parse_args( $args, array(
    990992        'reason'      => '',
    991993        'reply_id'    => 0,
    992994        'author_id'   => 0,
    993995        'revision_id' => 0
    994     );
    995 
    996     $r = bbp_parse_args( $args, $defaults, 'update_reply_revision_log' );
    997     extract( $r );
     996    ), 'update_reply_revision_log' );
    998997
    999998    // Populate the variables
    1000     $reason      = bbp_format_revision_reason( $reason );
    1001     $reply_id    = bbp_get_reply_id( $reply_id );
    1002     $author_id   = bbp_get_user_id ( $author_id, false, true );
    1003     $revision_id = (int) $revision_id;
     999    $r['reason']      = bbp_format_revision_reason( $r['reason'] );
     1000    $r['reply_id']    = bbp_get_reply_id( $r['reply_id'] );
     1001    $r['author_id']   = bbp_get_user_id ( $r['author_id'], false, true );
     1002    $r['revision_id'] = (int) $r['revision_id'];
    10041003
    10051004    // Get the logs and append the new one to those
    1006     $revision_log               = bbp_get_reply_raw_revision_log( $reply_id );
    1007     $revision_log[$revision_id] = array( 'author' => $author_id, 'reason' => $reason );
     1005    $revision_log                      = bbp_get_reply_raw_revision_log( $r['reply_id'] );
     1006    $revision_log[ $r['revision_id'] ] = array( 'author' => $r['author_id'], 'reason' => $r['reason'] );
    10081007
    10091008    // Finally, update
    1010     update_post_meta( $reply_id, '_bbp_revision_log', $revision_log );
    1011 
    1012     return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $reply_id );
     1009    update_post_meta( $r['reply_id'], '_bbp_revision_log', $revision_log );
     1010
     1011    return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $r['reply_id'] );
    10131012}
    10141013
Note: See TracChangeset for help on using the changeset viewer.