Category: WordPress

  • Bulk Entry Plugin Release

    I’ve released a new plugin for bulk creation of posts! Other plugins on the wordpress.org repository handled a strict subset of functionality such as posts and categories ( but not pages or tags), while others simply didn’t work. I set out to build an alternative that was extendable, reliable, and could handle custom post types…

  • Local Indicator v1.3

    After releasing v1.3, I thought I’d comment on the two significant changes I made. While there may be no visible change on the surface, new filters have been added to modify the colour and text of the indicator.

  • Clients Who Upload Huge Photos & Decompression Bombs

    Sometimes a client makes a blog post, and puts a photo in the middle. All good so far, until you realise the client has dragged an image from their brand new camera expecting a 10 Megapixel image to work. This is usually when people start talking about upload max file size limits, but this is…

  • Realisations

    Some pretty simple things people don’t realise when dealing with WordPress Nobody Remembers the API A lot of people worry that they don’t know the API, that it will take them a long time to memorise everything. Nobody memorises the API. It changes too fast, it’s too big, and it’s a waste of time when…

  • WordPress: Necessary Reading

    WordPress APIs In brief, WordPress hooks enable you to change how WordPress behaves without editing any core files. Because you leave the WordPress files untouched, you can painlessly upgrade your blog with each new version of WordPress. It’s this hooks architecture that makes WordPress the best blogging solution. – Adam Brown Adam Browns Hooks &…

  • Fixing JetPack Vanishing Menus & Order

    This is a fix for two issues with JetPack. First, it’s a much simpler method of stopping JetPack from sticking itself at the top of the menu under the Dashboard menu. Secondly, the code JetPack uses to rearrange the menu has bugs, meaning sometimes some menus vanish, e.g. Tools or Settings. Here’s a gist that…

  • WordPress Foundation & The GPL Issue

    There’s a problem that the WordPress Foundation & Core Team face, that puts them in unusual and awkward situations. It centers around a long running debate over the GPL and linking. A prime example being the recent situation of Jake Caputo: I've been blackballed from WordCamps: http://t.co/7vmV52Db — Jake Caputo (@jakecaputo) January 22, 2013 So…

  • Audio.php

    A lot of the talk about, and the APIs for attachments are centered around images. After all it’s their most common use case by a huge margin. But what about audio? I won’t pretend this is a comprehensive guide, but considering the lack of basic examples, here’s how to implement a basic audio attachment template.…

  • WordPress 3.5-ness & what’s new

    I gave a talk at SWIG, an event ran by our company every last Thursday of the month. I talked about what changed and what’s new in WordPress v3.5, everything from what the usual blogposts cover and what hasn’t been covered but might affect developers. I’ve uploaded the slides to Slideshare, you can view them…

  • Fixing Twitter OEmbed Language in WordPress

    A Twitter OEmbed returns tweets in the language of the requesting server, but say your an english site on a german server? You don’t want German retweet buttons! Here’s the fix. What Needs Adding The twitter OEmbed has some documented parameters, most notably, a lang attribute will fix the problem: lang Language code for the…

  • Auto-Grabbing Order Data From SellWire

    I’m going to demonstrate how to access order data programmatically from SellWire for a product. I’m going to be using this for building automation. Why Not Use SellWire APIs? At the moment SellWire provides no APIs, but they are planned. Until they are, some method of building automation is needed. To do this, I’ve programmed…

  • Emailing on Image Attachment Uploads

    Sometimes it’s useful to know when an image or audio attachment is added. Here I’ll outline how to send an emailwhen it happens. How It Works We start by hooking into add_attachment, and grabbing the user IDs of all administrators: // send to admins of the current blog/site $args = array(); $args[0] = ‘user_email’; $wp_user_search…

  • PHP Missing Methods & Levenshtein Distance

    I’m just going to leave this nifty little PHP snippet here, and recommend against it’s use. It could very well be shorter and more concise, probably a bit more performant too, but it works: View the code on Gist. It also encourages bad practices and ambiguity ( should elngth be mapped on to length1 or…

  • WordPress Flow Charts & Diagrams

    There’s a number of WordPress flow charts and diagrams in the community, to which the phrase worth their own weight in gold does no justice. For that adage to be true these charts would be so dense no light would reach them, rendering them utterly useless. So I’ve gathered a few of the more notable…

  • Typekit & “BESbswy”

    Perhaps you found a span containing the string ‘BESbswy’ in your content? Maybe your Google results contain the word ‘BESbswy’ repeated many times? Think you’ve been hacked? You haven’t. You’ve fallen prey to a runtime test in the Typekit/Webfontloader! I began noticing this in drafts I’d written while testing old versions of my TinyMCE Typekit…

  • Typekit WP Editor Styles

    Ever tried putting Typekit fonts on a site then trying to style the editor text in the backend? After trying many solutions, such as putting it in the admin header ( didn’t work ), or embedding the JS code in the editor iframe ( typekit security killed this ), I found a solution that worked!…

  • ‘Hacker’ issues WP Pull Request on GitHub for PHP Shell

    At the beginning of September, a user by the name of  ‘maxymax’ forked WordPress, added a PHP Shell to the twentyten theme, and made a pull request to merge back in to the official release. https://github.com/maxymax/WordPress/commit/2fa93590c7881fab043be7b8b51358894dbc1466 Suffice to say the inclusion of Saudi Shell v1.0 in TwentyTen may not have been the best idea, nevermind…

  • New Plugin – Local Indicator

    I was having trouble telling apart development local and production servers, and wanted to prevent mistakes. So I built myself a plugin to help indicate what server I was on! Presenting local indicator, a simple tool to help tell apart local installs of WordPress and remote installs. It adds the IP and server name to…

  • Tracking WordPress Site Updates Install in Google-Docs

    It’s important to keep WordPress up to date, but keeping track of all your sites can be a struggle. I recently had to list and check every site for updates, but I couldn’t use a service such as WP Remote. It had to be locally or private hosted. So I turned to Google Docs! Here…

  • Creating an Attachment for a File Already In Place

    There may come a time when there is a file in your uploads folder with no matching attachment post in the database. As unlikely as this is, it could happen, and when it does, it’s not clear how the upload mechanisms work. I came across a similar problem myself, here’s my code: View the code…