Filtering the Options API in WordPress

The Options API in WordPress is one of the many WordPress APIs we all use every day when developing with WordPress. A quick call to get_option() is not an uncommon sight. What if you could dynamically filter those options? You can.

Adding filters in WordPress is also a common practice. Combining this with the Options API can allow for, for example, the ability to change an option when in preview mode without committing to the change.

In the “Magazine” template in Canvas by WooThemes, for example, WooTumblog “image” and “video” posts are aware when they are present in the magazine-style grid. This is an example of filtering the Options API.

Continue reading

How to improve web developer coding practices (and code)

Every developer approaches their day to day development tasks from a different angle. In addition to this, each developer “designs” their code to suit their own personal preferences and approaches towards specifics in a project. When developers examine code written by other developers, we’re often critical (sometimes hyper-critical) of the code itself, mostly according to our personal preferences. While there is a place for being critical of code, and it should be encouraged, there are a few aspects of this criticism that should be left at the door… namely, the personal preferences.

While we all have our own preferences, it’s important to solidify a few areas when approaching code and to, ultimately, hone the developer’s mindset into certain guidelines. Below are a few thoughts I have running through my mind constantly while developing:

Continue reading

Presentations using SlideRocket

SlideRocket Logo

In the last week, Jeff and I presented a workshop at the GROW Academy’s BootCamp, discussing website design & development and focussing on using WordPress to do this. For both our introductory session on Monday and our more in-depth theory discussion on Wednesday, we needed a slideshow presentation to work through the various areas of website construction. Lets zoom back to Monday morning… I needed some slides… in a hurry.

As many of you know, I like to keep my computer as clean as possible. If I don’t use an application, it gets removed and everything that could go onto the machine is thought through before it’s loaded on. Thus, I don’t have PowerPoint, Keynote or anything of the sort… because I don’t need it. Suddenly, I did. Enter SlideRocket.

Continue reading

GROW Academy Bootcamp 2012

This week, Jeff and I will be presenting at our second GROW Academy Bootcamp session. We’ll be discussing “Website Design & Development” with the recruits, running through WordPress and how to setup a website using WordPress.com or WordPress.org.

The GROW Academy is an initiative to educate and empower the youth of today through technology. The Bootcamp session covers everything from social media and setting up e-mail, all the way through to search engine optimisation and an internet super-user course, for those who wish to continue on with more advanced studies. The GROW website’s “About” page (built on Canvas and Canvas BuddyPress by WooThemes) has a detailed explanation of the initiative and it’s founding partners.

Continue reading

A Quick Guide to the WordPress Transients API

The Transient API in WordPress is one of the many APIs available in the WordPress core that, once used, become invaluable and used on a daily basis. This is a quick guide to getting started with the transients API, when to use it and why.

The Transients API, while similar to the WordPress options API, has the addition of an expiry time. The API is used to store data in the database for a fix amount of time, at which point it is deleted and would need to be re-added, if one requires the data again. The WordPress Codex explains the Transients API as:

…very similar to the Options API but with the added feature of an expiration time, which simplifies the process of using the wp_options database table to store cached information.

From a technical standpoint, transients are also sped up by caching plugins, which store the data in memory, rather than in the database, making for a faster lookup.

Continue reading

More tips for styling the WordPress tinyMCE editor

Blue WordPress logo, courtesy http://wordpress.org/about/logos/A few weeks ago, I blogged about styling the tinyMCE editor in WordPress to resemble your WordPress theme’s content area. On this post, I received a comment from LA, asking if it’s possible to style the tinyMCE editor for specific posts or post templates. Folks, it’s WordPress… anything’s possible!

With my mission at hand, I set to work. I’d been thinking about this for a while after writing the initial blog post and am please to say that I have found a solution. Please be sure you’ve read through the initial blog post, as the main points are covered over there.

There are a few steps we need to go through here. They’re pretty straight forward, so bear with me. :)

Continue reading

A few guidelines for WordPress plugin development

The WordPress plugin API is vast and powerful. It allows developers to essentially hook code into almost any area of the WordPress system without modifying the core files at all. It also allows for the creation of standalone plugins that work within the WordPress system but do not hook into the core modules.

Over the last few weeks, WordPress plugin development has become one of my favourite things to do. I find it exciting to be able to create functionality, incorporate it seemlessly into the WordPress system and see it work smoothly with the other modules. While plugin development for WordPress is incredibly powerful, it also carries with it a few areas where people commonly stumble over and potentially lose interest in their code… which could be the next big thing. Here are a few guidelines I’ve picked up in order to step over the stumbling blocks.
Continue reading

Coding with the other side of your brain

This might seem like a weird topic for a blog post. Let me elaborate.

If you’ve ever coded for a system that is build in a convention you’re not used to (for example, coding using a MVC framework, if you’re not used to it), this concept will begin to make sense. It refers to the almost complete paradigm shift required when approaching an unfamiliar coding framework or system. Here are a few things that I’ve found ease the process of coding with the other side of your brain.
Continue reading