Changeset 8525
- Timestamp:
- 06/15/2014 06:12:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r8522 r8525 1259 1259 function bp_activity_new_comment( $args = '' ) { 1260 1260 1261 $ params= wp_parse_args( $args, array(1261 $r = wp_parse_args( $args, array( 1262 1262 'id' => false, 1263 1263 'content' => false, … … 1267 1267 ) ); 1268 1268 1269 extract( $params, EXTR_SKIP );1270 1271 1269 // Bail if missing necessary data 1272 if ( empty( $ content ) || empty( $user_id ) || empty( $activity_id) ) {1270 if ( empty( $r['content'] ) || empty( $r['user_id'] ) || empty( $r['activity_id'] ) ) { 1273 1271 return false; 1274 1272 } 1275 1273 1276 1274 // Maybe set current activity ID as the parent 1277 if ( empty( $parent_id ) ) { 1278 $parent_id = $activity_id; 1279 } 1275 if ( empty( $r['parent_id'] ) ) { 1276 $r['parent_id'] = $r['activity_id']; 1277 } 1278 1279 $activity_id = $r['activity_id']; 1280 1280 1281 1281 // Check to see if the parent activity is hidden, and if so, hide this comment publically. … … 1285 1285 // Insert the activity comment 1286 1286 $comment_id = bp_activity_add( array( 1287 'id' => $ id,1288 'content' => apply_filters( 'bp_activity_comment_content', $ content),1287 'id' => $r['id'], 1288 'content' => apply_filters( 'bp_activity_comment_content', $r['content'] ), 1289 1289 'component' => buddypress()->activity->id, 1290 1290 'type' => 'activity_comment', 1291 'user_id' => $ user_id,1291 'user_id' => $r['user_id'], 1292 1292 'item_id' => $activity_id, 1293 'secondary_item_id' => $ parent_id,1293 'secondary_item_id' => $r['parent_id'], 1294 1294 'hide_sitewide' => $is_hidden 1295 1295 ) ); … … 1299 1299 1300 1300 // Walk the tree to clear caches for all parent items 1301 $clear_id = $ parent_id;1301 $clear_id = $r['parent_id']; 1302 1302 while ( $clear_id != $activity_id ) { 1303 1303 $clear_object = new BP_Activity_Activity( $clear_id ); … … 1307 1307 wp_cache_delete( $activity_id, 'bp_activity' ); 1308 1308 1309 do_action( 'bp_activity_comment_posted', $comment_id, $ params, $activity );1309 do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity ); 1310 1310 1311 1311 return $comment_id;
Note: See TracChangeset
for help on using the changeset viewer.