Make WordPress Core

Ticket #36573: 36573.diff

File 36573.diff, 3.3 KB (added by flixos90, 10 years ago)

Patch adding the new parameter

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

     
    345345 * in the order of $before, link, and finally $after.
    346346 *
    347347 * @since 1.5.0
     348 * @since 4.6.0 The `$comment` argument was added.
    348349 *
    349  * @param string $linktext Optional. The text to display instead of the comment
    350  *                         author's email address. Default empty.
    351  * @param string $before   Optional. The text or HTML to display before the email link.
    352  *                         Default empty.
    353  * @param string $after    Optional. The text or HTML to display after the email link.
    354  *                         Default empty.
     350 * @param string         $linktext Optional. The text to display instead of the comment
     351 *                                 author's email address. Default empty.
     352 * @param string         $before   Optional. The text or HTML to display before the email link.
     353 *                                 Default empty.
     354 * @param string         $after    Optional. The text or HTML to display after the email link.
     355 *                                 Default empty.
     356 * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.
     357 *                                 Default is the current comment.
    355358 * @return string The HTML link between the $before and $after parameters.
    356359 */
    357 function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) {
    358         $url = get_comment_author_url();
     360function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
     361        $url = get_comment_author_url( $comment );
    359362        $display = ($linktext != '') ? $linktext : $url;
    360363        $display = str_replace( 'http://www.', '', $display );
    361364        $display = str_replace( 'http://', '', $display );
    … …  
    380383 * Displays the HTML link of the url of the author of the current comment.
    381384 *
    382385 * @since 0.71
     386 * @since 4.6.0 The `$comment` argument was added.
    383387 *
    384  * @param string $linktext Optional. Text to display instead of the comment author's
    385  *                         email address. Default empty.
    386  * @param string $before   Optional. Text or HTML to display before the email link.
    387  *                         Default empty.
    388  * @param string $after    Optional. Text or HTML to display after the email link.
    389  *                         Default empty.
     388 * @param string         $linktext Optional. Text to display instead of the comment author's
     389 *                                 email address. Default empty.
     390 * @param string         $before   Optional. Text or HTML to display before the email link.
     391 *                                 Default empty.
     392 * @param string         $after    Optional. Text or HTML to display after the email link.
     393 *                                 Default empty.
     394 * @param int|WP_Comment $comment  Optional. Comment ID or WP_Comment object.
     395 *                                 Default is the current comment.
    390396 */
    391 function comment_author_url_link( $linktext = '', $before = '', $after = '' ) {
    392         echo get_comment_author_url_link( $linktext, $before, $after );
     397function comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
     398        echo get_comment_author_url_link( $linktext, $before, $after, $comment );
    393399}
    394400
    395401/**