Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

PHP

Fishpig - Run Wordpress Shortcode in Magento

1
2
3
4
<?php
    $shortcode = '[cm_simple_form id=1]';
    echo Mage::helper('wordpress/filter')->process($shortcode);
?>
https://snipt.net/embed/2ba824b6e0854f3956d93060d1ad2c6c/
https://snipt.net/raw/2ba824b6e0854f3956d93060d1ad2c6c/
2ba824b6e0854f3956d93060d1ad2c6c
php
PHP
4
2016-12-07T19:40:57
True
False
False
/api/public/snipt/147561/
fishpig-run-wordpress-shortcode-in-magento
<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="nv">$shortcode</span> <span class="o">=</span> <span class="s1">&#39;[cm_simple_form id=1]&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">echo</span> <span class="nx">Mage</span><span class="o">::</span><span class="na">helper</span><span class="p">(</span><span class="s1">&#39;wordpress/filter&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">process</span><span class="p">(</span><span class="nv">$shortcode</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>
Fishpig, Magento, PHP, Wordpress

PHP

PHP Date triggered events

1
2
3
4
5
6
<?
$time_passed = (time() > strtotime('2014-01-18 00:00:00'));
    
    if ($time_passed) {
        // Do something
    } ?>
https://snipt.net/embed/8025a38e4bb59287149635f0207a45b6/
https://snipt.net/raw/8025a38e4bb59287149635f0207a45b6/
8025a38e4bb59287149635f0207a45b6
php
PHP
6
2016-12-10T18:43:19
True
False
False
Apr 03, 2014 at 11:33 PM
/api/public/snipt/105446/
php-date-triggered-events
<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="cp">&lt;?</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$time_passed</span> <span class="o">=</span> <span class="p">(</span><span class="nb">time</span><span class="p">()</span> <span class="o">&gt;</span> <span class="nb">strtotime</span><span class="p">(</span><span class="s1">&#39;2014-01-18 00:00:00&#39;</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a> <span class="k">if</span> <span class="p">(</span><span class="nv">$time_passed</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="c1">// Do something</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">}</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
Date, PHP
Copyrighted, illegal, or inappropriate content? Email [email protected].