• Hey.

    I would like to know why the ‘user_roles’ entry in the options table is prefix-sensitive (i.e. the entry name seems to be $prefix.'user_roles')?

    I can’t figure out the idea behind making it – and the corresponding ‘capabilities’ entry in the usermeta table – prefix-sensitive. Even on a multisite install, it seems this is still a single entry per each, even for the super-admin.

    So… why? Historical reasons? Now I’m genuinely curious.

    I found this when I was migrating a site that was originally configured for the ‘staging_’ prefix, but I needed to use the ‘live_’ prefix… and after changing it, I was suddenly unable to administer the site. I eventually stumbled onto the fact that the user role array was empty, and managed to fix it by renaming the options/staging_user_roles option to options/live_user_roles, followed by renaming usermeta/staging_capabilities to usermeta/live_capabilities for the admin user.

  • The topic ‘Request for rationale: $prefix.’options’ entry $prefix.’user_roles’’ is closed to new replies.