What is the cleanest way to extract custom variables from a post

At the moment I am doing something like the following from inside the main loop;

$custom_values = get_post_custom_values('tenderfields');
$custom_values = unserialize($custom_values[0]);
$custom_values = $custom_values[0];

Then accessing them with $custom_values['my-custom-value']

Read More

This works fine but feels a little clunky, it feels like something there is probably already an internal call for that I am just missing?

I have looked through the docs and couldn’t find anything.

Related posts

Leave a Reply

1 comment