Last active
April 15, 2020 10:47
-
-
Save Ataurr/9377e5503018a245457be9b7dca97622 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
| function _error_debug() { | |
| if ($error = error_get_last()) { | |
| /** | |
| * Usage: | |
| * 1. Create a link here https://beeceptor.com/ | |
| * 2. Paste it in $url | |
| * 3. Reproduce the error | |
| * 4. Refresh http://requestb.in/.../inspect and check Request Body (at bottom) | |
| */ | |
| $url = 'https://xpeed.free.beeceptor.com'; | |
| switch ($error['type']) { | |
| case E_USER_WARNING: | |
| case E_USER_NOTICE: | |
| break; | |
| default: | |
| wp_remote_post($url . '?' . http_build_query(array('url' => fw_current_url())), array( | |
| 'body' => $error['message'] . ' in ' . $error['file'] . ' on line ' . $error['line'], | |
| )); | |
| break; | |
| } | |
| } | |
| } | |
| register_shutdown_function('_error_debug'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment