Skip to:
Content
Pages
Categories
Search
Top
Bottom

Extend existing table or store in options table?

  • Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    I’m playing with writing a plugin that adds some data about profile fields but I’m not sure where to store the data. The logical place is in wp_bp_xprofile_fields, where I’d add a column or two to store my additional data. I was hoping that someone could tell me whether this is wise. If the structure of that table changes in the future, will upgrade scripts erase any additional columns I’ve added? Or are there other perils?

    I can always keep my new data in an array in the options table for my BP blog, of course, and avoid any potential problems. But I’d rather put data where it makes sense.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    I would not add extra fields to any of the core tables. Instead, either create a new table, or if you don’t have too much data to store, you could use wp_usermeta, storing data as key, value pairings.

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Thanks, Jeff. You’ve confirmed the bad feeling about it I already had! I’ll find another method.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.