Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PHP

Disable WordPress flood commenting protection

add_filter('comment_flood_filter', '__return_false');
https://snipt.net/embed/2d7a8ecd1a333a4714bac369cf0f10cd/
https://snipt.net/raw/2d7a8ecd1a333a4714bac369cf0f10cd/
2d7a8ecd1a333a4714bac369cf0f10cd
php
PHP
1
2016-12-07T04:16:21
True
False
False
Feb 24, 2016 at 12:20 PM
/api/public/snipt/144425/
disable-wordpress-flood-commenting-protection
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">add_filter(&#39;comment_flood_filter&#39;, &#39;__return_false&#39;);</span> </span></pre></div> </td></tr></table>
Comments, WordPress

PHP

WordPress - Convert text URL into a link

1
2
3
4
5
6
function make_text_links() 
{
	$string = get_the_content();
	return make_clickable($string);
}
add_filter( 'the_content', 'make_text_links' );
https://snipt.net/embed/b0f50c02c96045fe1b6db318eb227519/
https://snipt.net/raw/b0f50c02c96045fe1b6db318eb227519/
b0f50c02c96045fe1b6db318eb227519
php
PHP
6
2016-12-08T12:38:03
True
False
False
Jan 05, 2014 at 11:34 PM
/api/public/snipt/103981/
wordpress-convert-text-url-into-a-link
<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><span class="x">function make_text_links() </span> </span><span id="L-2"><a name="L-2"></a><span class="x">{</span> </span><span id="L-3"><a name="L-3"></a><span class="x"> $string = get_the_content();</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> return make_clickable($string);</span> </span><span id="L-5"><a name="L-5"></a><span class="x">}</span> </span><span id="L-6"><a name="L-6"></a><span class="x">add_filter( &#39;the_content&#39;, &#39;make_text_links&#39; );</span> </span></pre></div> </td></tr></table>
URL, WordPress, link

Text only

Year - Display the year on page

<?php echo date("Y"); ?>
https://snipt.net/embed/75909256c7d301d479e19246d9b2b510/
https://snipt.net/raw/75909256c7d301d479e19246d9b2b510/
75909256c7d301d479e19246d9b2b510
text
Text only
1
2016-12-07T04:18:38
True
False
False
/api/public/snipt/79404/
year-display-the-year-on-page
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php echo date(&quot;Y&quot;); ?&gt; </span></pre></div> </td></tr></table>
WordPress, Year
Copyrighted, illegal, or inappropriate content? Email [email protected].