Changeset 4490
- Timestamp:
- 11/23/2012 11:30:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/topics/functions.php
r4443 r4490 2556 2556 */ 2557 2557 function bbp_update_topic_revision_log( $args = '' ) { 2558 $defaults = array ( 2558 2559 // Parse arguments with default values 2560 $r = bbp_parse_args( $args, array( 2559 2561 'reason' => '', 2560 2562 'topic_id' => 0, 2561 2563 'author_id' => 0, 2562 2564 'revision_id' => 0 2563 ); 2564 $r = bbp_parse_args( $args, $defaults, 'update_topic_revision_log' ); 2565 extract( $r ); 2565 ), 'update_topic_revision_log' ); 2566 2566 2567 2567 // Populate the variables 2568 $r eason = 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 $r evision_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']; 2572 2572 2573 2573 // 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'] ); 2576 2576 2577 2577 // 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 ); 2579 2579 } 2580 2580
Note: See TracChangeset
for help on using the changeset viewer.