diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9cf183d09d..8660b0cbef 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -711,16 +711,18 @@ function get_edit_post_link( $id = 0, $context = 'display' ) { } /** - * Retrieve edit posts link for post. + * 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 = 'Edit This', $before = '', $after = '' ) { - global $post; +function edit_post_link( $link = 'Edit This', $before = '', $after = '', $id = 0 ) { + if ( !$post = &get_post( $id ) ) + return; if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) )