WordPress.org

Ready to get started?Download WordPress

Forums

Attach a custom string (or two) to each "Site" (5 posts)

  1. rmondello
    Member
    Posted 4 years ago #

    Hello there! Doing some multi-site development (I still want to call them blogs, gosh darn) that includes about a dozen different "Sites". Each Site is featured on the home page (/) in a rotator of images of the writer's faces (one writer per Site). Currently, I'm doing that with some custom PHP using a hook in my theme.

    Right now, my options are being stored as PHP arrays, with identification information that duplicates the canonical WordPress options. I'm now rewriting this rotator in a more sustain way, using data from the WordPress sites backend, but the requirement for my project requires me storing a custom string (or two) with each Site.

    Looking at the backend, there's a dump of the wp_X_options table, where X is the ID of the Site. Is there a way to add a field for a custom option to each of those options tables in a sustainable way, such that it'd show and be editable up on that dump? Rather than writing a plugin that acts as an editor for this data, storing it there seems to make the most sense to me.

    Thanks in advance for the help!

  2. Why not just use an avatar plugin and pull that info? :)

    Seems like a lot of wheel reinventing here.

  3. rmondello
    Member
    Posted 4 years ago #

    Andrea,

    Good point — but this is a little more custom than avatars. The image part is handled already, I just want a string (think a longer blog description) to be attached to each blog's database table.

  4. Yeah, you can stuff it in the options table. Same exact way as if it were a single stand-along blog.

  5. rmondello
    Member
    Posted 4 years ago #

    Andrea, thanks a bunch! Do you know of any tools to make this easy on the front-end? I want my client to be able to easily edit these strings (attached to each blog's options table) in the future, long after I'm gone.

    Again, I appreciate your advice.

Topic Closed

This topic has been closed to new replies.

About this Topic