Instantly share code, notes, and snippets.

View upload-resources-message-filter.php
* Image and PDF compression resources message at upload screens.
function upload_suggestions_message() { ?>
<h3>Uploading Files Guide</h3>
<p class="upload-html-bypass hide-if-no-js">Here are a few options to reduce the size of images/files before uploading them (please always do this to help load the site faster for visitors!!).</p>
<li><a href="" target="_blank"> - Compress all your images with this site.</a></li>
<li><a href="" target="_blank"> - Compress those PDFs as well for clients or on page display.</a></li>
View get-primary-category.php
* Get Primary Category
* Get the primary category of the post.
* Should be used inside the loop.
* @param string $att Attribute of the category that is desired (if 'all' is passed, will return whole object)
* @param boolean $wpseo Whether or not to use WPSEO (if it's on/installed)
View has-gallery.php
View wp-remove-featured-image.php
View array-deep-key-search.php
//deep search array for key
function multi_key_exists( array $arr, $key ){
// is in base array?
if ( array_key_exists($key, $arr) ) return true;
// check arrays contained in this array
foreach( $arr as $element ){
if( is_array($element) && multi_key_exists($element, $key) ){