mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Use current_user_can
git-svn-id: http://svn.automattic.com/wordpress/trunk@3505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6c4e7e48d2
commit
66828c03e9
@ -205,13 +205,10 @@ function get_feed_link($feed='rss2') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
||||||
global $user_ID, $post;
|
global $post;
|
||||||
|
|
||||||
get_currentuserinfo();
|
if ( ! current_user_can('edit_post', $post->ID) )
|
||||||
|
|
||||||
if ( !user_can_edit_post($user_ID, $post->ID) ) {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if ( is_attachment() )
|
if ( is_attachment() )
|
||||||
return;
|
return;
|
||||||
@ -223,11 +220,9 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
|
function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
|
||||||
global $user_ID, $post, $comment;
|
global $post, $comment;
|
||||||
|
|
||||||
get_currentuserinfo();
|
if ( ! current_user_can('edit_post', $post->ID) )
|
||||||
|
|
||||||
if ( !user_can_edit_post_comments($user_ID, $post->ID) )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
|
$location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user