-
-
Save kamalahmed/ed55e4cd8a226c6ffcb8c88b1ce70b58 to your computer and use it in GitHub Desktop.
Save Plugin Error Messages in the database for The Plugin Generated x Characters of Unexpected Output During Activation errors
This file contains 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 tl_save_error() { | |
update_option( 'plugin_error', ob_get_contents() ); | |
} | |
add_action( 'activated_plugin', 'tl_save_error' ); | |
/* Then to display the error message: */ | |
echo get_option( 'plugin_error' ); | |
/* Or you could do the following: */ | |
file_put_contents( 'C:\errors' , ob_get_contents() ); // or any suspected variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment