Support » Alpha/Beta/RC » update_usermeta broken?

  • hi,

    the past few days i tried to setup some roles via scripting.

    there i found that (i do not know, how to set roles via code, the codex gives nothing about that, i just did a grep about the code, and looking at mysql.log while updating some roles via wp-admin)

    if i try to update with a value “{s:13:”administrator”;b:1;}” it does, if i am using “a:1:{s:13:"administrator";b:1;}” it breaks the value and will add “s:31:\"” in front of the value ;-((

    so i cannot insert the right value “´a:1:{s:13:”administrator”;b:1;}´” into the database, it comes there as s:31:\"a:1:{s:13:"administrator";b:1;}

    how can i fix that behavior? or how can i add roles to users via code? 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am having a very similar problem. I am trying to insert a:1:{s:6:"member";b:1;}, and it is inserting it as s:23:"a:1:{s:6:"member";b:1;}";

    Was there any solution to this?

    Ok, so I found the solution. I just had to run the string into the maybe_unserialize function and it inserted it correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘update_usermeta broken?’ is closed to new replies.