Forums

user_meta hack help (2 posts)

  1. josephcizek
    Member
    Posted 5 years ago #

    I am setting up WP where there are multiple sites via different database prefixes. I want all the sites to use the same user table, but different user_meta tables (so, users can have different privilage levels on different sites).

    What of course happens is that when a user registers on one site, but logs in on another, there is no user_meta entry for them, and they get the "You do not have sufficient permissions to access this page." message. What I'd like to do is add code at that point that, if there is a user but no user_meta entry, it creates one with a level 0 privilage.

    What I haven't found yet is which page generates that above error message. Can somebody clue me in?

    Thanks much!

  2. Brian Layman
    Member
    Posted 5 years ago #

    You might want to look into making your changes in get_userdata within pluggable-functions.php.

    There's an if ($metavalues) check there that you could toss an else statement into to provide some default rights.

Topic Closed

This topic has been closed to new replies.

About this Topic