Fix for bug #559, just use user_can_ functions

git-svn-id: https://develop.svn.wordpress.org/trunk@2195 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
michelvaldrighi 2005-02-01 11:14:45 +00:00
parent 31ba3d15e0
commit 35445592b7
1 changed files with 4 additions and 14 deletions

View File

@ -174,16 +174,11 @@ function get_feed_link($feed='rss2') {
}
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
global $user_level, $post;
global $user_ID, $post;
get_currentuserinfo();
if ($user_level > 0) {
$authordata = get_userdata($post->post_author);
if ($user_level < $authordata->user_level) {
return;
}
} else {
if (!user_can_edit_post($user_ID, $post->ID)) {
return;
}
@ -192,16 +187,11 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
}
function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
global $user_level, $post, $comment;
global $user_ID, $post, $comment;
get_currentuserinfo();
if ($user_level > 0) {
$authordata = get_userdata($post->post_author);
if ($user_level < $authordata->user_level) {
return;
}
} else {
if (!user_can_edit_post_comments($user_ID, $post->ID)) {
return;
}