Make WordPress Core


Ignore:
Timestamp:
02/07/2006 01:06:04 AM (19 years ago)
Author:
ryan
Message:

Use current_user_can

File:
1 edited

Legend:

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

    r3440 r3505  
    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.