Make WordPress Core

Ticket #51189: 51189.2.diff

File 51189.2.diff, 976 bytes (added by joedolson, 4 years ago)

Updated patch - build comment link using existing comment link function

  • src/wp-includes/comment-template.php

     
    16471647 *
    16481648 * @since 2.7.0
    16491649 * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object.
    1650  *
     1650 * 
    16511651 * @param array          $args {
    16521652 *     Optional. Override default arguments.
    16531653 *
     
    17061706                return false;
    17071707        }
    17081708
     1709        if ( get_option( 'page_comments' ) ) {
     1710                $permalink = str_replace( '#comment-' . $comment->comment_ID, '', get_comment_link( $comment ) );
     1711        } else {
     1712                $permalink = get_permalink( $post->ID );
     1713        }
     1714
    17091715        /**
    17101716         * Filters the comment reply link arguments.
    17111717         *
     
    17501756                                                'unapproved'      => false,
    17511757                                                'moderation-hash' => false,
    17521758                                        ),
    1753                                         get_permalink( $post->ID )
     1759                                        $permalink
    17541760                                )
    17551761                        ) . '#' . $args['respond_id'],
    17561762                        $data_attribute_string,