Dynamically resized text ensures that when necessary, text can fit to a pixel-perfect width in any browser and any operating system. While fonts are similar enough across most browsers and OS, in headlines or other locations where overflow text would break layout, occasionally, one browser will have issues where otheres don’t. In this case, we [...]
Posted 27 February 2012
AJAX is full of stumbling blocks. From browser support to user expectations, it can cause more problems than it solves when used at the CMS level. In AJAXed WordPress, I had to find a way to enable javascript processing on arbitrary scripts from other plugins loaded with AJAX. Typically, this is impossible because most inline [...]
Posted 27 November 2011
Here is a very simple function to run stripslashes on an array and all of its child arrays. The function below is for PHP 5 and takes a single argument which should consist of an array. It loops through all elements of the array, and if an element is an array, it calls itself on [...]
Posted 26 July 2010
A question that came up in regards to jQuery Performance was: is it faster to define the type of element before you set the ID. Basically, is jQuery('textarea#content_box') better than jQuery('#content_box')? The thinking is that because the latter is more specific, the parser has to do less work to find the element. But this is [...]
Posted 23 July 2010
In jQuery, there are 5 different selectors that can find an element’s descendants. One of these methods, will grab only first-level children but it is included with the other four to demonstrate the differences. By profiling these 5 selectors, we can get a basic idea of which selector is the fastest, but, as you will [...]
Posted 19 July 2010
Escaping dynamic regex strings automatically in PHP is a lot harder than you would think. You can’t just use a string like"\$myregex" because PHP will try to escape the $. You can’t even double slash it like \\$myregex because this doesn’t work in the regex engine. To get both the PHP and the regular expressions [...]
Posted 10 July 2010
See those wonderfully beautiful article and comment toggle buttons at the top of every post? (Or in the post image for those reading in a feed reader.) Those are images, but they weren’t created in Photoshop: they are screenshots of buttons designed with Firefox gradients. That’s right, when I was working on them, I wanted [...]
Posted 3 July 2010
Moving a WordPress website can be quite the hassle, but with the following bit of MySQL it can be a lot easier to switch websites from one host to another. The following is a MySQL search and replace of all fields and text content that could conceivably contain links to your old website. It replaces [...]
Posted 10 June 2010
Currently, it is possible to create CSS gradients in IE 6, IE7, IE8, Webkit-browsers (Chrome 2.0+ and Safari), and Firefox 3.6+. As of this post, Opera doesn’t support CSS-only gradient backgrounds. There are other methods to create gradient backgrounds with JavaScript or via the canvas element; however, I prefer the CSS only methods. Each of [...]
Posted 2 June 2010