Skip to content

Commit

Permalink
Comment link requires a comment object
Browse files Browse the repository at this point in the history
  • Loading branch information
johngodley committed May 31, 2020
1 parent b26d0a0 commit cf12475
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/core/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public function get_search_conditions() {
}

public function get_actions( Result $result ) {
$link = get_edit_comment_link( $result->get_row_id() );
$id = $result->get_row_id();
$link = get_edit_comment_link( $id );
$comment = get_comment( $id );
$raw = $result->get_raw();

if ( $link ) {
$view = get_comment_link( intval( $raw['comment_post_ID'], 10 ) );
if ( $link && is_object( $comment ) ) {
$view = get_comment_link( $comment );

return array_filter( [
'edit' => str_replace( '&', '&', $link ),
Expand Down

0 comments on commit cf12475

Please sign in to comment.