From e6c673e76ca2294d49653c2d05b6027b24b7e806 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 21 May 2009 18:43:04 +0000 Subject: [PATCH] Add post ID arg to edit_post_link(). Props coffee2code. fixes #9898 git-svn-id: http://svn.automattic.com/wordpress/trunk@11425 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9cf183d09..8660b0cbe 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 ) )