Changeset 13041
- Timestamp:
- 08/13/2021 12:19:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/actions/reply.php
r12371 r13041 16 16 */ 17 17 function bp_activity_action_post_comment() { 18 if ( ! is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )18 if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'reply' ) ) { 19 19 return false; 20 } 21 22 if ( ! isset( $_POST['comment_form_id'] ) ) { 23 return false; 24 } 25 26 $activity_id = absint( wp_unslash( $_POST['comment_form_id'] ) ); 27 28 if ( ! isset( $activity_id ) ) { 29 return false; 30 } 20 31 21 32 // Check the nonce. 22 check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment ');33 check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment_' . $activity_id ); 23 34 24 35 /** … … 27 38 * @since 1.2.0 28 39 * 29 * @param string $ valueID of the activity being replied to.40 * @param string $activity_id ID of the activity being replied to. 30 41 */ 31 $activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $ _POST['comment_form_id']);42 $activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $activity_id ); 32 43 33 44 /** … … 51 62 } 52 63 53 $comment_id = bp_activity_new_comment( array( 54 'content' => $content, 55 'activity_id' => $activity_id, 56 'parent_id' => false 57 )); 64 $comment_id = bp_activity_new_comment( 65 array( 66 'content' => $content, 67 'activity_id' => $activity_id, 68 'parent_id' => false 69 ) 70 ); 58 71 59 if ( ! empty( $comment_id ) )72 if ( ! empty( $comment_id ) ) { 60 73 bp_core_add_message( __( 'Reply Posted!', 'buddypress' ) ); 61 else74 } else { 62 75 bp_core_add_message( __( 'There was an error posting that reply. Please try again.', 'buddypress' ), 'error' ); 76 } 63 77 64 78 bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
Note: See TracChangeset
for help on using the changeset viewer.