Skip to content

Instantly share code, notes, and snippets.

@toddlahman
Created August 22, 2013 01:35
Show Gist options
  • Select an option

  • Save toddlahman/6302280 to your computer and use it in GitHub Desktop.

Select an option

Save toddlahman/6302280 to your computer and use it in GitHub Desktop.

Revisions

  1. toddlahman created this gist Aug 22, 2013.
    15 changes: 15 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?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