id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
12197 "edit_post_link() - ""Edit Post"" shows as link title no matter what $link is entered" sc0ttkclark "Currently when this is used:
{{{
edit_post_link('Edit this Blah Blah');
}}}
Then this is output:
{{{
Edit this Blah Blah
}}}
Of course, that's an i18n ""Edit Post"" but still, this should be overwritten by the $link parameter (if provided). And even then, if none is provided the Title should be the same as the Anchor text.
See below for my proposed bug fix:
{{{
/**
* Display edit post link for post.
*
* @since 1.0.0
*
* @param string $link Optional. Anchor text.
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param int $id Optional. Post ID.
*/
function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
if ( !$post = &get_post( $id ) )
return;
if ( !$url = get_edit_post_link( $post->ID ) )
return;
if ( null === $link )
$link = __('Edit This');
$link = '' . $link . '';
echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
}
}}}" defect (bug) closed normal 3.1 Template 2.9.1 normal fixed