WordPress.org

Make WordPress Core

Ticket #10879: 10879.diff

File 10879.diff, 1.5 KB (added by ryan, 9 years ago)
  • wp-includes/link-template.php

     
    720720 * @param string $after Optional. Display after edit link.
    721721 * @param int $id Optional. Post ID.
    722722 */
    723 function edit_post_link( $link = 'Edit This', $before = '', $after = '', $id = 0 ) {
     723function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
    724724        if ( !$post = &get_post( $id ) )
    725725                return;
    726726
    727727        if ( !$url = get_edit_post_link( $post->ID ) )
    728728                return;
    729729
     730        if ( null === $link )
     731                $link = __('Edit This');
     732
    730733        $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>';
    731734        echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
    732735}
     
    817820 * @param string $after Optional. Display after edit link.
    818821 * @return string|null HTML content, if $echo is set to false.
    819822 */
    820 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) {
     823function edit_comment_link( $link = null, $before = '', $after = '' ) {
    821824        global $comment, $post;
    822825
    823826        if ( $post->post_type == 'page' ) {
     
    828831                        return;
    829832        }
    830833
     834        if ( null === $link )
     835                $link = __('Edit This');
     836
    831837        $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
    832838        echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
    833839}