4

What is the best way to display/dump all custom fields associated with a post? It doesn't have to be pretty, I just need to verify what is being saved in what field array for debugging.

11

you can use get_post_custom() which returns a multidimensional array with all custom fields of a particular post or page:

echo '<pre>';
print_r(get_post_custom($post_id));
echo '</pre>';
|improve this answer|||||
2

get_post_custom($post->ID) is what you need

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.