snipt

Ctrl+h for KB shortcuts

HTML+PHP

Share This

<?php if (function_exists('sharethis_button')) { sharethis_button(); } ?>
https://snipt.net/embed/63e8abe0a35fd30da06b0719e3d79968/
/raw/63e8abe0a35fd30da06b0719e3d79968/
63e8abe0a35fd30da06b0719e3d79968
html+php
HTML+PHP
1
2019-08-15T20:15:34
True
False
False
/api/public/snipt/748/
share-this
<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="cp">&lt;?php</span> <span class="k">if</span> <span class="p">(</span><span class="nb">function_exists</span><span class="p">(</span><span class="s1">&#39;sharethis_button&#39;</span><span class="p">))</span> <span class="p">{</span> <span class="nx">sharethis_button</span><span class="p">();</span> <span class="p">}</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
social

PHP

PHP ternary operator

1
2
3
4
<?php
// Example usage for: Ternary Operator
$action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
?>
https://snipt.net/embed/9993a2570f3419514bbae2e7ce1f11c8/
/raw/9993a2570f3419514bbae2e7ce1f11c8/
9993a2570f3419514bbae2e7ce1f11c8
php
PHP
4
2019-08-06T07:39:33
True
False
False
/api/public/snipt/747/
php-ternary-operator
<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></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 class="c1">// Example usage for: Ternary Operator</span> </span><span id="L-3"><a name="L-3"></a><span class="nv">$action</span> <span class="o">=</span> <span class="p">(</span><span class="k">empty</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;action&#39;</span><span class="p">]))</span> <span class="o">?</span> <span class="s1">&#39;default&#39;</span> <span class="o">:</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;action&#39;</span><span class="p">];</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
ternary

HTML+PHP

Akismet key

1d471281fa90
https://snipt.net/embed/81d706c2d10f55c01db121cd6c4f5bad/
/raw/81d706c2d10f55c01db121cd6c4f5bad/
81d706c2d10f55c01db121cd6c4f5bad
html+php
HTML+PHP
1
2019-08-17T03:41:08
True
False
False
/api/public/snipt/733/
akismet-key
<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>1d471281fa90 </span></pre></div> </td></tr></table>
plugins, special

HTML+PHP

WP Print

<?php if(function_exists('wp_print')) { print_link(); } ?>
https://snipt.net/embed/03c564b3587162ee4198d544184c272b/
/raw/03c564b3587162ee4198d544184c272b/
03c564b3587162ee4198d544184c272b
html+php
HTML+PHP
1
2019-08-14T08:39:37
True
False
False
/api/public/snipt/732/
wp-print
<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="cp">&lt;?php</span> <span class="k">if</span><span class="p">(</span><span class="nb">function_exists</span><span class="p">(</span><span class="s1">&#39;wp_print&#39;</span><span class="p">))</span> <span class="p">{</span> <span class="nx">print_link</span><span class="p">();</span> <span class="p">}</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
plugins

HTML+PHP

WP Email This

<?php if(function_exists('wp_email')) { email_link(); } ?>
https://snipt.net/embed/9fcb388cc6764772fdcaee812f591771/
/raw/9fcb388cc6764772fdcaee812f591771/
9fcb388cc6764772fdcaee812f591771
html+php
HTML+PHP
1
2019-07-27T05:37:21
True
False
False
/api/public/snipt/731/
wp-email-this
<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="cp">&lt;?php</span> <span class="k">if</span><span class="p">(</span><span class="nb">function_exists</span><span class="p">(</span><span class="s1">&#39;wp_email&#39;</span><span class="p">))</span> <span class="p">{</span> <span class="nx">email_link</span><span class="p">();</span> <span class="p">}</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
plugins

HTML+PHP

Display only on index.php

<?php if ( ( is_home() ) ) { ?>
<?php } ?>
https://snipt.net/embed/a428d3876a463973b0af7e25bc0a83b1/
/raw/a428d3876a463973b0af7e25bc0a83b1/
a428d3876a463973b0af7e25bc0a83b1
html+php
HTML+PHP
2
2019-08-18T22:07:55
True
False
False
/api/public/snipt/730/
display-only-on-indexphp
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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 class="k">if</span> <span class="p">(</span> <span class="p">(</span> <span class="nx">is_home</span><span class="p">()</span> <span class="p">)</span> <span class="p">)</span> <span class="p">{</span> <span class="cp">?&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="cp">&lt;?php</span> <span class="p">}</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
special

HTML+PHP

Generate PDF

http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=<?php the_permalink();?>
https://snipt.net/embed/413af47a4a66a13de8fb01c47a803db6/
/raw/413af47a4a66a13de8fb01c47a803db6/
413af47a4a66a13de8fb01c47a803db6
html+php
HTML+PHP
1
2019-08-15T01:57:32
True
False
False
/api/public/snipt/729/
generate-pdf
<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>http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=<span class="cp">&lt;?php</span> <span class="nx">the_permalink</span><span class="p">();</span><span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
loop