Add post ID arg to edit_post_link(). Props coffee2code. fixes #9898

git-svn-id: https://develop.svn.wordpress.org/trunk@11425 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-21 18:43:04 +00:00
parent fbafa6f628
commit 2e1ed76289
1 changed files with 5 additions and 3 deletions

View File

@ -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 ) )