Last active
January 27, 2017 21:26
-
-
Save mandiwise/254e4db53686c07fccf5 to your computer and use it in GitHub Desktop.
Save an option to the database containing unexpected output during plugin activation
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 | |
/** | |
* Usage: "echo get_option('plugin_error');" or look for the option the DB after activation | |
* | |
* @link http://thehungrycoder.com/wordpress/how-i-have-solved-the-the-plugin-generated-xxxx-characters-of-unexpected-output-during-activation-problem.html | |
*/ | |
function save_error(){ | |
update_option( 'plugin_error', ob_get_contents()) ; | |
} | |
add_action( 'activated_plugin','save_error' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment