Make WordPress Core

Changeset 2195


Ignore:
Timestamp:
02/01/2005 11:14:45 AM (20 years ago)
Author:
michelvaldrighi
Message:

Fix for bug #559, just use user_can_ functions

File:
1 edited

Legend:

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

    r2181 r2195  
    175175
    176176function edit_post_link($link = 'Edit This', $before = '', $after = '') {
    177     global $user_level, $post;
     177    global $user_ID, $post;
    178178
    179179    get_currentuserinfo();
    180180
    181     if ($user_level > 0) {
    182         $authordata = get_userdata($post->post_author);
    183         if ($user_level < $authordata->user_level) {
    184             return;
    185         }
    186     } else {
     181    if (!user_can_edit_post($user_ID, $post->ID)) {
    187182        return;
    188183    }
     
    193188
    194189function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
    195     global $user_level, $post, $comment;
     190    global $user_ID, $post, $comment;
    196191
    197192    get_currentuserinfo();
    198193
    199     if ($user_level > 0) {
    200         $authordata = get_userdata($post->post_author);
    201         if ($user_level < $authordata->user_level) {
    202             return;
    203         }
    204     } else {
     194    if (!user_can_edit_post_comments($user_ID, $post->ID)) {
    205195        return;
    206196    }
Note: See TracChangeset for help on using the changeset viewer.