{"absolute_url": "/jbmckee/wordpress-plugin-activation-error-capture/", "blog_post": false, "code": "function tl_save_error() {\n    update_option( 'plugin_error',  ob_get_contents() );\n}\nadd_action( 'activated_plugin', 'tl_save_error' );\n/* Then to display the error message: */\necho get_option( 'plugin_error' );", "created": "2019-07-29T15:45:42.122497", "description": "", "description_rendered": "", "embed_url": "https://snipt.net/embed/b295acb7b1a32b379d7f56134267265c/", "full_absolute_url": "/jbmckee/wordpress-plugin-activation-error-capture/", "id": 107, "lexer": "text", "line_count": 6, "log_entries": [{"code": "function tl_save_error() {\n    update_option( 'plugin_error',  ob_get_contents() );\n}\nadd_action( 'activated_plugin', 'tl_save_error' );\n/* Then to display the error message: */\necho get_option( 'plugin_error' );", "created": "2019-07-29T15:45:42.458166", "diff": "--- \n+++ \n@@ -0,0 +1,6 @@\n+function tl_save_error() {\n+    update_option( 'plugin_error',  ob_get_contents() );\n+}\n+add_action( 'activated_plugin', 'tl_save_error' );\n+/* Then to display the error message: */\n+echo get_option( 'plugin_error' );", "user": "jbmckee"}], "meta": "", "modified": "2026-04-27T10:33:34.042646", "publish_date": "2019-07-29T15:45:41.961347", "raw_url": "/raw/b295acb7b1a32b379d7f56134267265c/", "resource_uri": "/api/public/snipt/107/", "slug": "wordpress-plugin-activation-error-capture", "stylized": "<table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre><a href=\"#L-1\">1</a>\n<a href=\"#L-2\">2</a>\n<a href=\"#L-3\">3</a>\n<a href=\"#L-4\">4</a>\n<a href=\"#L-5\">5</a>\n<a href=\"#L-6\">6</a></pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span></span><span id=\"L-1\"><a name=\"L-1\"></a>function tl_save_error() {\n</span><span id=\"L-2\"><a name=\"L-2\"></a>    update_option( &#39;plugin_error&#39;,  ob_get_contents() );\n</span><span id=\"L-3\"><a name=\"L-3\"></a>}\n</span><span id=\"L-4\"><a name=\"L-4\"></a>add_action( &#39;activated_plugin&#39;, &#39;tl_save_error&#39; );\n</span><span id=\"L-5\"><a name=\"L-5\"></a>/* Then to display the error message: */\n</span><span id=\"L-6\"><a name=\"L-6\"></a>echo get_option( &#39;plugin_error&#39; );\n</span></pre></div>\n</td></tr></table>", "tags": [{"absolute_url": "/public/tag/wordpress/", "id": 7, "name": "wordpress", "resource_uri": "/api/public/tag/7/", "snipts": "/api/public/snipt/?tag=7"}], "title": "Wordpress plugin activation error capture", "user": {"absolute_url": "/jbmckee/", "email_md5": "f4da96308b6db1b0b19738a7c105d3da", "id": 1, "resource_uri": "/api/public/user/1/", "snipts": "/api/public/snipt/?user=1", "snipts_count": 72, "username": "jbmckee"}}