WordPress.org

Ready to get started?Download WordPress

Forums

need help! retrieving user capabilities outside the blog (2 posts)

  1. guitavares
    Member
    Posted 2 years ago #

    What I am trying to do is control the access to a page that is located outside the WP installation.

    So I load the WP with proper:
    require("../wp/wp-load.php");

    I am already logged in the admin panel as administrator.
    But the following keeps returning false:

    if (current_user_can('administrator')) echo 'true'; else echo 'false';
    if (current_user_can('manage_options')) echo 'true'; else echo 'false';

    I can't figure out why. Anyone?

  2. guitavares
    Member
    Posted 2 years ago #

    Weirdest thing;
    I was getting the FALSE because I was accessing the file using "www." on my browser.
    It just started working when I entered the address without the www prefix.
    Must be because my blog address is configured without www.

Topic Closed

This topic has been closed to new replies.

About this Topic