snipt

Ctrl+h for KB shortcuts

JavaScript

Get ID in js w/jQuery dom object return

$( document.getElementById("some_id") );
https://snipt.net/embed/a263aa5f5037f8d42f5005eb040cd348/
https://snipt.net/raw/a263aa5f5037f8d42f5005eb040cd348/
a263aa5f5037f8d42f5005eb040cd348
js
JavaScript
1
2016-09-24T02:38:11
True
False
False
Apr 08, 2014 at 09:22 AM
/api/public/snipt/107720/
get-id-in-js-wjquery-dom-object-return
<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 id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">&quot;some_id&quot;</span><span class="p">)</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
element, get, id, jquery, js

PHP

Get attached file size

1
2
3
<?php
filesize( get_attached_file( $attachment->ID ) );
?>
https://snipt.net/embed/b6f8a64ff28dbbfbf082660c07534b17/
https://snipt.net/raw/b6f8a64ff28dbbfbf082660c07534b17/
b6f8a64ff28dbbfbf082660c07534b17
php
PHP
3
2016-09-29T18:15:48
True
False
False
Aug 01, 2013 at 07:11 AM
/api/public/snipt/71160/
get-attached-file-size
<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></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="nb">filesize</span><span class="p">(</span> <span class="nx">get_attached_file</span><span class="p">(</span> <span class="nv">$attachment</span><span class="o">-&gt;</span><span class="na">ID</span> <span class="p">)</span> <span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
attach, attached, file, get, size, wordpress, wp
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.