• The following code works fine in a single-site install, but when I activate a network on the same site I get the following error:

    You do not have sufficient permissions to access this page.

    Here is the code:

    if(!function_exists(‘is_user_logged_in’)) {
    require(ABSPATH . WPINC . ‘/pluggable.php’);
    }

    if ($opts[‘d404_enable’] == 1 && !is_user_logged_in()) { //if detect 404 mode is enabled

    $computer_id = $wpdb->escape($_SERVER[‘REMOTE_ADDR’]);

    if ($this->d404_checkLock($computer_id)) { //if locked out
    die(__(‘Please come back later’));
    }

    add_action(‘wp_head’, array(&$this,’d404_check’)); //register action
    }

    Please note this is in the constructor of my plugin code.

The topic ‘is_user_logged_in() problem on network install’ is closed to new replies.