Skip to content

Instantly share code, notes, and snippets.

@Gkiokan
Last active January 2, 2017 09:03
Show Gist options
  • Save Gkiokan/c812105ea74d259a0ae7b753a7a3a32d to your computer and use it in GitHub Desktop.
Save Gkiokan/c812105ea74d259a0ae7b753a7a3a32d to your computer and use it in GitHub Desktop.
WP Error Handling on Plugins
/*
GistName: WP Error Handling
Author: Gkiokan Sali
Url: www.gkiokan.net
Description:
Use this for debugging activision errors.
Create a error_activation.txt error log in the spezific plugin directory.
*/
if(WP_DEBUG)
add_action('activated_plugin','my_save_error');
function my_save_error() {
$error = ob_get_contents();
if(empty($error)) return;
file_put_contents(dirname(__file__).'/error_activation.txt', ob_get_contents());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment