Skip to content

Commit

Permalink
Bug fix to allow users to edit their own comments
Browse files Browse the repository at this point in the history
Fix included here involves:
1) passing in the postid/commentid.

See issue designwall#238 for details.
  • Loading branch information
timhibberd authored Dec 22, 2019
1 parent 9d04a5d commit 981e1e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/content-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?php dwqa_print_user_badge( $comment->user_id, true ); ?>
<?php printf( _x( 'replied %s ago', '%s = human-readable time difference', 'dw-question-answer' ), human_time_diff( get_comment_time( 'U', true ) ) ); ?>
<div class="dwqa-comment-actions">
<?php if ( dwqa_current_user_can( 'edit_comment' ) ) : ?>
<?php if ( dwqa_current_user_can( 'edit_comment', get_the_ID(), $comment->comment_id ) ) : ?>
<a href="<?php echo esc_url( add_query_arg( array( 'comment_edit' => $comment->comment_ID ) ) ) ?>"><?php _e( 'Edit', 'dw-question-answer' ) ?></a>
<?php endif; ?>
<?php if ( dwqa_current_user_can( 'delete_comment' ) ) : ?>
Expand Down

0 comments on commit 981e1e8

Please sign in to comment.