mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Remove old preview stuff. Allow draft posts to be displayed if the logged in user has edit permissions on the draft. Don't use cruft-free links for drafts since they might not have a slug. http://mosquito.wordpress.org/view.php?id=1220
git-svn-id: https://develop.svn.wordpress.org/trunk@2523 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -351,10 +351,10 @@ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
|
||||
/* returns true if $user_id can edit $post_id */
|
||||
function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
|
||||
$author_data = get_userdata($user_id);
|
||||
$post_data = get_postdata($post_id);
|
||||
$post_author_data = get_userdata($post_data['Author_ID']);
|
||||
$post = get_post($post_id);
|
||||
$post_author_data = get_userdata($post->post_author);
|
||||
|
||||
if ( (($user_id == $post_author_data->ID) && !($post_data['post_status'] == 'publish' && $author_data->user_level < 2))
|
||||
if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))
|
||||
|| ($author_data->user_level > $post_author_data->user_level)
|
||||
|| ($author_data->user_level >= 10) ) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user