Home › Forums › General Issues › Want to use get_post_meta instead of get_field for array › Reply To: Want to use get_post_meta instead of get_field for array
Thanks – I understand what that snippet does and it makes sense that it should work, but I get this error message:
Warning: unserialize() expects parameter 1 to be string, array given in (followed by the path to my theme file).
I tried changing it to add true to indicate that it’s a string and not an array(?) but that didn’t change the error.
$myvalues = unserialize( get_post_meta($post->ID,'my_key',true) );
Any ideas?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.