WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_post_custom() Serialized data works funny (4 posts)

  1. Leo Blanchette
    Member
    Posted 1 year ago #

    I saw that get_post_custom() does some serializing and such, as opposed to get_post_meta.

    Problem: I did update_post_meta() with a serialized string. When I do get_post_custom() its like... a serialized serialized string. At this point, just way too much serial. :D

    How do I:

    A: Get it without it serializing stuff?
    B: Get the output to match get_post_meta?

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    Use maybe_unserialize() on each piece of the output as you loop through it.

  3. Leo Blanchette
    Member
    Posted 1 year ago #

    Thank you much.

  4. Andrew Bartel
    Member
    Posted 1 year ago #

    Sure thing, happy coding.

    Please mark as resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.