Make WordPress Core

Ticket #36538: 36538.diff

File 36538.diff, 1.6 KB (added by flixos90, 9 years ago)

patch with the new parameters

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

     
    14021402 * Display edit comment link with formatting.
    14031403 *
    14041404 * @since 1.0.0
     1405 * @since 4.6.0 The `$comment` and `$class` arguments were added.
    14051406 *
    1406  * @param string $text   Optional. Anchor text.
    1407  * @param string $before Optional. Display before edit link.
    1408  * @param string $after  Optional. Display after edit link.
     1407 * @param string         $text    Optional. Anchor text.
     1408 * @param string         $before  Optional. Display before edit link.
     1409 * @param string         $after   Optional. Display after edit link.
     1410 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object.
     1411 * @param string         $class   Optional. Add custom class to link.
    14091412 */
    1410 function edit_comment_link( $text = null, $before = '', $after = '' ) {
    1411         $comment = get_comment();
     1413function edit_comment_link( $text = null, $before = '', $after = '', $comment = 0, $class = 'comment-edit-link' ) {
     1414        $comment = get_comment( $comment );
    14121415
    14131416        if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
    14141417                return;
     
    14181421                $text = __( 'Edit This' );
    14191422        }
    14201423
    1421         $link = '<a class="comment-edit-link" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>';
     1424        $link = '<a class="' . esc_attr( $class ) . '" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>';
    14221425
    14231426        /**
    14241427         * Filter the comment edit link anchor tag.