Localize default strings for edit_comment_link() and edit_post_link(). fixes #10879

git-svn-id: https://develop.svn.wordpress.org/trunk@11987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-10-01 17:41:09 +00:00
parent 04772d1b9f
commit faead879c7

View File

@ -720,13 +720,16 @@ function get_edit_post_link( $id = 0, $context = 'display' ) {
* @param string $after Optional. Display after edit link. * @param string $after Optional. Display after edit link.
* @param int $id Optional. Post ID. * @param int $id Optional. Post ID.
*/ */
function edit_post_link( $link = 'Edit This', $before = '', $after = '', $id = 0 ) { function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
if ( !$post = &get_post( $id ) ) if ( !$post = &get_post( $id ) )
return; return;
if ( !$url = get_edit_post_link( $post->ID ) ) if ( !$url = get_edit_post_link( $post->ID ) )
return; return;
if ( null === $link )
$link = __('Edit This');
$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>'; $link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
} }
@ -817,7 +820,7 @@ function get_edit_comment_link( $comment_id = 0 ) {
* @param string $after Optional. Display after edit link. * @param string $after Optional. Display after edit link.
* @return string|null HTML content, if $echo is set to false. * @return string|null HTML content, if $echo is set to false.
*/ */
function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { function edit_comment_link( $link = null, $before = '', $after = '' ) {
global $comment, $post; global $comment, $post;
if ( $post->post_type == 'page' ) { if ( $post->post_type == 'page' ) {
@ -828,6 +831,9 @@ function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) {
return; return;
} }
if ( null === $link )
$link = __('Edit This');
$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
} }