kisukedeath

Wordpress Snipet Debug Error

Apr 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. To save the error message to debug the problem the following code snippets can help
  2.  
  3. function tl_save_error() {
  4.     update_option( 'plugin_error',  ob_get_contents() );
  5. }
  6. add_action( 'activated_plugin', 'tl_save_error' );
  7. /* Then to display the error message: */
  8. echo get_option( 'plugin_error' );
  9. /* Or you could do the following: */
  10. file_put_contents( 'C:\errors' , ob_get_contents() ); // or any suspected variable
Advertisement
Add Comment
Please, Sign In to add comment