SVG (vector) Social Icons

Below are some optimized SVGs I’ve made using the official assets provided by the companies.  Feel free to grab the code for your own projects.  Alternatively, checkout the plugin. [socialmonger size=’7vw’ color=’#f66′ align=center padding=’0 1ex’] Tweets by sleepradio https://facebook.com/andrewklimek https://instagram.com/andrewklimek https://www.pinterest.com/ https://www.youtube.com/watch?v=WE8wBQBTkxQ https://plus.google.com/+andrewklimek https://www.linkedin.com/in/andrewklimek [/socialmonger] In case you’re not to familiar with SVGs, they are […]

WordPress Debugging

define( ‘WP_DEBUG’, true ); if ( WP_DEBUG ) { define( ‘WP_DEBUG_DISPLAY’, false ); define( ‘WP_DEBUG_LOG’, true ); @ini_set( ‘display_errors’, 0 ); define( ‘SCRIPT_DEBUG’, true ); }

Auto Tab Script to Advance Users to the Next Input Field

JavaScript <script>   // auto tab   (function(){     var maxLengthInputs = document.querySelectorAll(‘#myform input[maxlength]’);     for(var i=0, l = maxLengthInputs.length; i<l; i++){         maxLengthInputs[i].addEventListener(‘input’, autotab );     }     function autotab(e){         if ( this.value.length == this.maxLength){             var allInputs = document.querySelectorAll(‘#myform input’);             var index = 1 + […]

Changing WordPress Default “From” Email

add_filter(‘wp_mail_from’, function($email){     if( substr($email,0,10) === ‘wordpress@’)         $email = get_option(‘admin_email’);     return $email; }); add_filter(‘wp_mail_from_name’, function($name){     if($name === ‘WordPress’)         $name = str_replace( ‘’’, “‘”, get_option(‘blogname’) );     return $name; });

Warn users before they exit a form

document.addEventListener(‘DOMContentLoaded’, function(){     function exitWarning(e){         e.preventDefault();     }     function setExitWarning(){         window.addEventListener(‘beforeunload’, exitWarning );         this.removeEventListener(‘change’, setExitWarning );     }     var forms = document.querySelectorAll(‘main form’);          for ( var i = 0, l = forms.length; i < l; i++ ) {         forms[i].addEventListener(‘change’, setExitWarning );    […]

Restore Default User Roles in WordPress

This is a pretty goofy function, but a client once deleted the default user roles using some plugin, and I just threw this into functions.php to re-create them. It’s hooked onto admin_init, so it runs when you load any back-end page.  I set a transient that keeps the function from running more than once (and […]

Incremental and Random Key Code Generator

function readycat_keygen( $atts ) {          extract( shortcode_atts(         array(             ‘len’ => null,             ‘char’ => ‘ABCDEFGHJKMNPQRSTUVWXYZ23456789’,// don’t bother with I L 1 O or 0             ‘type’ => ‘count’,             ‘countby’ => null,             ‘pre’ => null,            […]