Title: Checking user capabilities
Last modified: August 19, 2016

---

# Checking user capabilities

 *  814079
 * [17 years, 8 months ago](https://wordpress.org/support/topic/checking-user-capabilities/)
 * Hello, newbie here;
 * I’m looking for a way to check a users capabilities (or even if they’re logged
   in), but seem to be hindered by the scope on the server.
 * WordPress is installed in a directory off the root:
    [http://www.domain.com/wordpress/](http://www.domain.com/wordpress/)
 * But I want to check in a file on the root if the user is already logged in to
   WordPress.
    [http://www.domain.com/test.php](http://www.domain.com/test.php)
 * Now, I can use current_user_can() etc. if I were checking in the WordPress directory,
   but as soon as you leave that it says you’re not logged in.
 * Is there a way round this or is it just a security thing? Sorry if it’s obvious,
   but I’m rather new to all this and not a particularly good coder either.

Viewing 1 replies (of 1 total)

 *  [maybegeek](https://wordpress.org/support/users/maybegeek/)
 * (@maybegeek)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/checking-user-capabilities/#post-824156)
 * Hi there,
 * such an function would be really good.
 * Until something will be integrated you could use something like that, to check
   the rights of the logged in user and show him the edit-link of a post with a 
   certain ID:
 *     ```
       <?php
       if (current_user_can('edit_post', $post->ID)) {
       echo "&middot; <a href='" . get_bloginfo('wpurl') . "/wp-admin/post.php?action=edit&post={$post->ID}' class='edit'>" . "edit</a>";
       }
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Checking user capabilities’ is closed to new replies.

## Tags

 * [current_user_can](https://wordpress.org/support/topic-tag/current_user_can/)
 * [user query](https://wordpress.org/support/topic-tag/user-query/)

 * 1 reply
 * 2 participants
 * Last reply from: [maybegeek](https://wordpress.org/support/users/maybegeek/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/checking-user-capabilities/#post-824156)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
