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-09-28T03:14:55
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 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 - Copyright with automatic year

// http://www.w3schools.com/php/php_date.asp
&copy; 2010-<?php echo date("Y");?>
https://snipt.net/embed/52b0484218e23e721f9ed8e9bb9f0293/
https://snipt.net/raw/52b0484218e23e721f9ed8e9bb9f0293/
52b0484218e23e721f9ed8e9bb9f0293
php
PHP
2
2016-09-21T10:26:18
True
False
False
/api/public/snipt/147491/
copyright-with-automatic-year
<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 id="L-1"><a name="L-1"></a><span class="x">// http://www.w3schools.com/php/php_date.asp</span> </span><span id="L-2"><a name="L-2"></a><span class="x">&amp;copy; 2010-</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nb">date</span><span class="p">(</span><span class="s2">&quot;Y&quot;</span><span class="p">);</span><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
Copyright, Date, PHP
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.