Created
July 20, 2021 01:24
-
-
Save bob-moore/039a4a9aaf3730a6df72f9e4bf34cc99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_print_error( $item, $action = 'shutdown' ) { | |
add_action( $action, function() use( $item ) { | |
printf( '<script>console.log(%s);</script>', json_encode( $item, JSON_PARTIAL_OUTPUT_ON_ERROR, JSON_PRETTY_PRINT ) ); | |
}, 9999 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment