snipt

Ctrl+h for KB shortcuts

PHP

take over the suspended/archived message in WPMU

<?php

add_filter('graceful_fail', 'nice_graceful_fail');
 
function nice_graceful_fail($message) {
  // output your HTML template here - be sure to print $message out
  // I created a suspended.html file in wp-content and required it, like so:
  require_once(WP_CONTENT_DIR . '/errors/suspended.html');
  exit;
}
https://snipt.net/embed/7f480ef455b9fc017f043944d3e3e059/
/raw/7f480ef455b9fc017f043944d3e3e059/
7f480ef455b9fc017f043944d3e3e059
php
PHP
10
2019-07-21T22:46:31
True
False
False
/api/public/snipt/71/
take-over-the-suspendedarchived-message-in-wpmu
<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> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nx">add_filter</span><span class="p">(</span><span class="s1">&#39;graceful_fail&#39;</span><span class="p">,</span> <span class="s1">&#39;nice_graceful_fail&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="k">function</span> <span class="nf">nice_graceful_fail</span><span class="p">(</span><span class="nv">$message</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-6"><a name="L-6"></a> <span class="c1">// output your HTML template here - be sure to print $message out</span> </span><span id="L-7"><a name="L-7"></a> <span class="c1">// I created a suspended.html file in wp-content and required it, like so:</span> </span><span id="L-8"><a name="L-8"></a> <span class="k">require_once</span><span class="p">(</span><span class="nx">WP_CONTENT_DIR</span> <span class="o">.</span> <span class="s1">&#39;/errors/suspended.html&#39;</span><span class="p">);</span> </span><span id="L-9"><a name="L-9"></a> <span class="k">exit</span><span class="p">;</span> </span><span id="L-10"><a name="L-10"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
graceful_fail, wordpress, wpmu