I'm writing a sidebar for my site and I'm trying to check if:
- The page is a post, via:
is_post()
- The author can edit the post via:
current_user_can('edit_post')
I'm trying to combine both of these conditions, but I'm horrid at PHP and I just can't figure out the syntax to do so. I figured it'd be something like below. Could you please let me know what I'm doing wrong? I'm assuming it's something simple, but my inexperience is causing problems and I can't find the right example/documentation to help me out.
<?php if is_single and if (current_user_can('edit_post')) { ?> <li><a href="#">Edit post</a></li> <?php ;} ?>