The MU forums have moved to WordPress.org

storing arrays in blog_options instead of only strings? (4 posts)

  1. fleshins
    Member
    Posted 14 years ago #

    How would I store/manage an array of strings unique to each blog? I was thinking I would simply manage the array through add/update/get_blog_options() but it looks like get_blog_options() expects the stored data to be a string rather than an array (get_blog_options() runs stripslashes() on the value and barfs on the array expecting a string)

    Thanks for helping the n00b. :)

  2. SteveAtty
    Member
    Posted 14 years ago #

    You convert your array to a string before storing it and then convert it back when you pull it back out using get_options

  3. fleshins
    Member
    Posted 14 years ago #

    ok! will give that a shot :)

  4. fleshins
    Member
    Posted 14 years ago #

    worked like a charm!
    add_blog_option(2, 'subscribers', implode(" ", $this->subscribers));

About this Topic

  • Started 14 years ago by fleshins
  • Latest reply from fleshins