mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 05:38:07 +01:00
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:
parent
31ba3d15e0
commit
35445592b7
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user