WordPress.org

Ready to get started?Download WordPress

Forums

get_currentuserinfo and init (3 posts)

  1. yge
    Member
    Posted 8 years ago #

    I am using 2.0 and I have a plugin that use's server's REMOTE_USER to auto create user account for the first time user. I hooked it to "init" action but the index page's side bar still shows the "login" menu item (until I do a refresh). It appears the set_currentuserinfo() function get called from wp_register() (in template sidebar.php) once before the init() is called. Is this a bug? Is there a hook get called before "init"?

    Thanks!

  2. moshu
    Member
    Posted 8 years ago #

    [no need for re-posting if in the wrong section. Just let the mods know and they can move it over. Double posts are more annoying than misplaced posts! - deleted the other one]

  3. yge
    Member
    Posted 8 years ago #

    I came to understand that init does get called before the get_currentuserinfo() but the problem is that autmoatical login's call to wp_setcookie() does have any effect on the first page load as acoordinate to http://www.php.net/manual/en/function.setcookie.php, one of common pitfalls of cookie is that "Cookies will not become visible until the next loading of a page that the cookie should be visible for.". WP's cookie based login check will never works for the first page load.

Topic Closed

This topic has been closed to new replies.

About this Topic