Skip to content

Instantly share code, notes, and snippets.

View marcinkrzeminski's full-sized avatar
🍌
👈🏼 my fuel 🤪

Marcin Krzemiński marcinkrzeminski

🍌
👈🏼 my fuel 🤪
View GitHub Profile
@marcinkrzeminski
marcinkrzeminski / gist:3884631
Created October 13, 2012 13:30 — forked from padolsey/gist:527683
JS: IE Detect
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@marcinkrzeminski
marcinkrzeminski / acf-get-field-key.php
Created November 26, 2018 08:36 — forked from mcguffin/acf-get-field-key.php
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.