Make WordPress Core


Ignore:
Timestamp:
12/13/2005 07:19:56 PM (20 years ago)
Author:
ryan
Message:

Attachment enhancements from skeltoac. fixes #2074

File:
1 edited

Legend:

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

    r3122 r3303  
    210210    get_currentuserinfo();
    211211
    212     if ( !user_can_edit_post($user_ID, $post->ID) || is_attachment() ) {
     212    if ( !user_can_edit_post($user_ID, $post->ID) ) {
    213213        return;
    214214    }
    215215
    216     $location = get_settings('siteurl') . "/wp-admin/post.php?action=edit&post=$post->ID";
     216    if ( is_attachment() )
     217        $file = 'attachments';
     218    else
     219        $file = 'post';
     220
     221    $location = get_settings('siteurl') . "/wp-admin/{$file}.php?action=edit&post=$post->ID";
    217222    echo $before . "<a href=\"$location\">$link</a>" . $after;
    218223}
Note: See TracChangeset for help on using the changeset viewer.