Make WordPress Core

Ticket #9898: 9898.diff

File 9898.diff, 869 bytes (added by coffee2code, 15 years ago)

Patch mentioned in original submission.

  • wp-includes/link-template.php

     
    711711}
    712712
    713713/**
    714  * Retrieve edit posts link for post.
     714 * Display edit post link for post.
    715715 *
    716716 * @since 1.0.0
    717717 *
    718718 * @param string $link Optional. Anchor text.
    719719 * @param string $before Optional. Display before edit link.
    720720 * @param string $after Optional. Display after edit link.
     721 * @param int $id Optional. Post ID.
    721722 */
    722 function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
    723         global $post;
     723function edit_post_link( $link = 'Edit This', $before = '', $after = '', $id = 0 ) {
     724        if ( !$post = &get_post( $id ) )
     725                return;
    724726
    725727        if ( $post->post_type == 'page' ) {
    726728                if ( !current_user_can( 'edit_page', $post->ID ) )