I was wondering if there was a easier way to debug these instead of sending the following code via the wp_mail() function. Right now I’m sending these code snippets implode(', ', $_POST['acf']); and `implode(‘, ‘, get_fields($post_ID)); to see what is in them, but it would be much easier to see these directly in the browser instead of mailing them to myself each time.
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.