/raw/b295acb7b1a32b379d7f56134267265c/
b295acb7b1a32b379d7f56134267265c
text
Text only
6
2025-04-04T11:36:08
True
False
False
Jul 29, 2019 at 03:45 PM
/api/public/snipt/107/
wordpress-plugin-activation-error-capture
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a>
<a href="#L-5">5</a>
<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() {
</span><span id="L-2"><a name="L-2"></a> update_option( 'plugin_error', ob_get_contents() );
</span><span id="L-3"><a name="L-3"></a>}
</span><span id="L-4"><a name="L-4"></a>add_action( 'activated_plugin', 'tl_save_error' );
</span><span id="L-5"><a name="L-5"></a>/* Then to display the error message: */
</span><span id="L-6"><a name="L-6"></a>echo get_option( 'plugin_error' );
</span></pre></div>
</td></tr></table>