Adding metadata to fields?

Home Forums WPAlchemy Adding metadata to fields?

This topic contains 1 reply, has 1 voice, and was last updated by  aendrew 1 year, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2489

    aendrew
    Participant

    I’m using WP Alchemy to choose specific pins from a pinboard that I’ve scraped with QueryPath. Each pin has three different variables — title, image URL and pin URL.

    In a multi-checkbox setup, I’m using the URL as the value to ensure checkboxes remain linked to whatever image is pulled from Pinterest, but I’m not sure what’s the best way of storing extra metadata — i.e., the title and pin URL.

    Any thoughts? I thought about adding a hidden field, all hidden fields for all pins will get added as meta data to every post — which’ll bog down the database hugely.

    #2490

    aendrew
    Participant

    Ha! Got it. I serialized the array I wanted to store as metadata, then I base64_encoded()’d it. Then I saved the base64_encoded serialized string as the field value.

    Then, on the front-end, I base64_unencoded it and then unserialized it.

    I may write a tutorial on what I did, it’s kinda cool (I think, anyhoo.).

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

You must be logged in to reply to this topic.