From e1325ba94b4e84efcb5da7f7faba8ad17651781b Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Tue, 1 Feb 2005 11:14:45 +0000 Subject: [PATCH] Fix for bug #559, just use user_can_ functions git-svn-id: http://svn.automattic.com/wordpress/trunk@2195 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-links.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index 3a3bde19de..e672b20de3 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -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; }