Make WordPress Core

Changeset 3567


Ignore:
Timestamp:
02/22/2006 07:17:28 PM (18 years ago)
Author:
ryan
Message:

Fix edit links.

File:
1 edited

Legend:

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

    r3538 r3567  
    209209    global $post;
    210210
    211     if ( ! current_user_can('edit_post', $post->ID) )
    212         return;
    213 
    214211    if ( is_attachment() )
    215212        return;
    216     else
     213
     214    if( $post->post_type == 'page' ) {
     215        if ( ! current_user_can('edit_page', $post->ID) )
     216            return;
     217        $file = 'page';
     218    } else {
     219        if ( ! current_user_can('edit_post', $post->ID) )
     220            return;
    217221        $file = 'post';
     222    }
    218223
    219224    $location = get_settings('siteurl') . "/wp-admin/{$file}.php?action=edit&post=$post->ID";
     
    224229    global $post, $comment;
    225230
    226     if ( ! current_user_can('edit_post', $post->ID) )
    227         return;
    228 
    229     $location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
     231    if( $post->post_type == 'page' )
     232        if ( ! current_user_can('edit_page', $post->ID) )
     233            return;
     234    else
     235        if ( ! current_user_can('edit_post', $post->ID) )
     236            return;
     237
     238    $location = get_settings('siteurl') . "/wp-admin/comment.php?action=editcomment&comment=$comment->comment_ID";
    230239    echo $before . "<a href='$location'>$link</a>" . $after;
    231240}
Note: See TracChangeset for help on using the changeset viewer.