Skip to main content
updated deprecated function && assign function call to a variable, otherwise the condition is false (last check in if clause) & it should be && and not or ||, because both condition should be evaluate true
Source Link

I think the post edit link should be visible to post author and moderator(editor user or how have that capability)

So my proposed code is like this

global $post, $current_user;$post;
get_currentuserinfo$current_user = wp_get_current_user();

if(current_user_can( 'edit_others_posts', $post->ID ) ||&& ($post->post_author == $current_user->ID))  { 

    //show edit link    
}

I think the post edit link should be visible to post author and moderator(editor user or how have that capability)

So my proposed code is like this

global $post, $current_user;
get_currentuserinfo();

if(current_user_can( 'edit_others_posts', $post->ID ) || ($post->post_author == $current_user->ID))  { 

    //show edit link    
}

I think the post edit link should be visible to post author and moderator(editor user or how have that capability)

So my proposed code is like this

global $post;
$current_user = wp_get_current_user();

if(current_user_can( 'edit_others_posts', $post->ID ) && ($post->post_author == $current_user->ID))  { 

    //show edit link    
}
Source Link

I think the post edit link should be visible to post author and moderator(editor user or how have that capability)

So my proposed code is like this

global $post, $current_user;
get_currentuserinfo();

if(current_user_can( 'edit_others_posts', $post->ID ) || ($post->post_author == $current_user->ID))  { 

    //show edit link    
}