Print_r doesn't return anything; var_dump shows NULL Print_r doesn't return anything; var_dump shows NULL wordpress wordpress

Print_r doesn't return anything; var_dump shows NULL


Most likely, the outputted data is stored within some output buffer. If you're pretty sure you want to debug your code this way, try adding wp_die(); call right after you output data using print_r. That should help!

One more thing: sometimes some of the code (not this particular case) is actually never outputted due to more complex data flow. For this cases it might be a good idea to use some 3-rd party debugging tools or, if you're looking for simpler solution, you can write some of the output to some log file, and check the file afterwards.

Good Luck!