I am building a membership site that requires the comment template to only be visible to the author of the post and users with editor privileges.
I am finding it hard to check if it is the author of the post, I have been at this for hours and cannot find anything in the codex or on google.
maybe I am writhing it wrong, but my brain is fried right now.
I know manage_options is wrong, but I cannot find the right code.
Any help is welcome. Thank you in advance
<?php
global $current_user;
get_currentuserinfo();
if (is_user_logged_in() && (current_user_can('edit_others_posts') || $current_user->ID == $post->post_author) ) {
echo 'user is logged in and can either edit other posts or is the author of the current post';
}
?>
(@geofeedz)
13 years, 11 months ago
I am building a membership site that requires the comment template to only be visible to the author of the post and users with editor privileges.
I am finding it hard to check if it is the author of the post, I have been at this for hours and cannot find anything in the codex or on google.
This is what I have so far
maybe I am writhing it wrong, but my brain is fried right now.
I know manage_options is wrong, but I cannot find the right code.
Any help is welcome. Thank you in advance