Home › Forums › General Issues › Easier way $_POST['acf'] with get_fields($post->ID) › Reply To: Easier way $_POST['acf'] with get_fields($post->ID)
The problem with seeing them in the browser is that it will interrupt the process.
For example, you can output to the browser like this
echo '$_POST['acf'] = <pre>'; print_r($_POST['acf']); echo '</pre>';
echo 'get_fields() = <pre>'; print_r(get_fields($post_ID)); echo '</pre>';
This code will cause a “Headers already sent” error when WP tries to redirect to the admin page after saving. However, for debugging, this is generally what I do. I’m expecting the error and I want to interrupt the process so I can see what’s going on.
You can also use the debug log. This will output values to the error log and then you can open the log to see what’s in it.
error_log(implode(', ', $_POST['acf']));
error_log(implode(', ', get_fields($post_ID));
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.