Changeset 9054 for trunk/src/bp-activity/bp-activity-functions.php
- Timestamp:
- 09/28/2014 06:20:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r9052 r9054 1330 1330 */ 1331 1331 function bp_activity_new_comment( $args = '' ) { 1332 $bp = buddypress(); 1333 $errors = new WP_Error(); 1334 $feedback = __( 'There was an error posting your reply. Please try again.', 'buddypress' ); 1335 1336 if ( empty( $bp->activity->errors ) ) { 1337 $bp->activity->errors = array(); 1338 } 1332 1339 1333 1340 $r = wp_parse_args( $args, array( … … 1341 1348 // Bail if missing necessary data 1342 1349 if ( empty( $r['content'] ) || empty( $r['user_id'] ) || empty( $r['activity_id'] ) ) { 1350 $errors->add( 'missing_data', $feedback ); 1351 $bp->activity->errors['new_comment'] = $errors; 1352 1343 1353 return false; 1344 1354 } … … 1356 1366 // Bail if the parent activity does not exist 1357 1367 if ( empty( $activity->date_recorded ) ) { 1368 $errors->add( 'missing_activity', __( 'Sorry, the item you are replying to no longer exists.', 'buddypress' ) ); 1369 $bp->activity->errors['new_comment'] = $errors; 1370 1358 1371 return false; 1359 1372 } … … 1387 1400 1388 1401 do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity ); 1402 1403 if ( empty( $comment_id ) ) { 1404 $errors->add( 'comment_failed', $feedback ); 1405 $bp->activity->errors['new_comment'] = $errors; 1406 } 1389 1407 1390 1408 return $comment_id;
Note: See TracChangeset
for help on using the changeset viewer.