Viewing 1 replies (of 1 total)
  • What you are seeing there is a serilized PHP array. That’s how at least soem postmeta stuff is stored.

    When you see that, you can use this sort of code:

    $value = unserialize($meta);

    That will give you the array, and you can process it as you would any other array.

    I do have two tips though. Firstly, if you can, you can call get_post_meta() with ‘true’ at the end to get a single value instead of the array. That may or may not work for your situation. Secondly, there’s a great WordPress function of maybe_unserliaze() which will do everything for you without you needing to do any more checks.

Viewing 1 replies (of 1 total)

The topic ‘How do I parse postmeta meta_values with vanilla PHP’ is closed to new replies.