Make WordPress Core

Changeset 3552


Ignore:
Timestamp:
02/19/2006 10:47:51 AM (18 years ago)
Author:
ryan
Message:

Use current_user_can. fixes #2441

File:
1 edited

Legend:

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

    r3440 r3552  
    206206
    207207function edit_post_link($link = 'Edit This', $before = '', $after = '') {
    208     global $user_ID, $post;
    209 
    210     get_currentuserinfo();
    211 
    212     if ( !user_can_edit_post($user_ID, $post->ID) ) {
    213         return;
    214     }
     208    global $post;
     209
     210    if ( ! current_user_can('edit_post', $post->ID) )
     211        return;
    215212
    216213    if ( is_attachment() )
     
    224221
    225222function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
    226     global $user_ID, $post, $comment;
    227 
    228     get_currentuserinfo();
    229 
    230     if ( !user_can_edit_post_comments($user_ID, $post->ID) )
     223    global $post, $comment;
     224
     225    if ( ! current_user_can('edit_post', $post->ID) )
    231226        return;
    232227
Note: See TracChangeset for help on using the changeset viewer.