user_can_edit_post [ WordPress Function ]
user_can_edit_post ( $user_id, $post_id, $blog_id = 1 )
| Parameters: |
|
| See: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: user_can_edit_post_date, user_can_delete_post, user_can_create_post, user_can_edit_user, user_can_edit_post_comments
Whether user can edit a post.
Source
<?php
function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );
$author_data = get_userdata($user_id);
$post = get_post($post_id);
$post_author_data = get_userdata($post->post_author);
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;
} else {
return false;
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- WordPress › Support » WP-Cal Hack - PHP help
user_can_edit_post. which is in the code: if(user_can_edit_post($user_ID, $post- >ID)){ $canedit = true; echo "Add event<div class='clear'></div>"; }. Originally ...
wordpress.org - WordPress › Support » Users lvl 10 being editable for lvl 9
Around line 350 in wp-includes/functions-post.php, look for the user_can_edit_post() function, and change this in the if statement: $author_data- >user_level >= ...
wordpress.org - WordPress › Support » author permissions
function user_can_edit_post($user_id, $post_id, $blog_id = 1) { $author_data = get_userdata($user_id); $post = get_post($post_id); $post_author_data ...
wordpress.org - Site Management | Texas Heritage Music & Dance Club
Any authorized user can edit “Post” content, trash it, etc., so be careful not to edit or trash something that someone else posted. If a viewer has content that would ...
thmdc.com