WordPress.org

Make WordPress Core

Changeset 11425


Ignore:
Timestamp:
05/21/09 18:43:04 (5 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r11383 r11425  
    712712 
    713713/** 
    714  * Retrieve edit posts link for post. 
     714 * Display edit post link for post. 
    715715 * 
    716716 * @since 1.0.0 
     
    719719 * @param string $before Optional. Display before edit link. 
    720720 * @param string $after Optional. Display after edit link. 
    721  */ 
    722 function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { 
    723     global $post; 
     721 * @param int $id Optional. Post ID. 
     722 */ 
     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' ) { 
Note: See TracChangeset for help on using the changeset viewer.