Active Record Callbacks for Nested Models

I was banging my head against the wall today trying to add a before_save filter to a model that was getting saved in a nested form. ┬áIt seems that only the top level model’s callbacks will be called. So say you have save some kind of Order with many LineItems all at once (via the [...]

Read full story Comments { 56 }

Getting Started With Node.js

I’ve been hearing a lot about Node.js recently, so I decided to install it and give it a whirl. I know I’m a little late to the game, but here’s my breakdown of Node.js; What is Node.js? This one took a little while to get my head around but essentially node.js allows you to do [...]

Read full story Comments { 147 }

Blog excerpt in Ruby on Rails

Today I needed to output a blog excerpt similar to the_excerpt() in Wordpress. I came up with the following Ruby on Rails function that seems to work pretty well.

Read full story Comments { 65 }

Learning Regular Expressions From the jQuery Source

I recently undertook a personal challenge of going through the jQuery source as a way of improving my understanding of Javascript and Javascript frameworks. One of the first things I encountered when I took a look through the code was some daunting looking regular expressions. Now, I’ve had a good bit of exposure to regular [...]

Read full story Comments { 101 }

Adding Your Own Callbacks to WordPress AJAX Requests

The WordPress administration page is loaded with AJAX calls. From time to time, a developer may want to perform some custom javascript action when one of these calls is completed. JQuery allows custom events to be triggered, but at this time the WordPress javascript does not make use of them. A developer on the WP-Hackers [...]

Read full story Comments { 135 }

Building Javascript Widgets

I found a great tutorial today on building Javascript widgets. We include dynamically generated widgets on each of our calculator pages on Calculator Pro. Up until today, the widgets would manually submit back to the CalculatorPro site, which isn’t very useful for site owners looking to add a widget to their site. Following some of [...]

Read full story Comments { 185 }

Wordstream API Class

The other day, I created a Wordstream API WordPress plugin for use on my business partner Joel and I’s site Domain Superstar. As part of that process I wrote a PHP wrapper class for Wordstream. I offered it to Wordstream, and they decided to use it as part of their example code and were kind [...]

Read full story Comments { 1 }

Adding Simple Role Based Permissions to your WordPress Plugin

In response to a user request, I recently added the ability to restrict access to my Copyscape Plugin to only certain WordPress roles. WordPress provides some pretty simple APIs to manipulate Capabilities and Roles which can be invaluable in plugins where you want to limit access to certain functionality. I think this functionality is something [...]

Read full story Comments { 0 }

Adding Custom Post Types to the WordPress Google Sitemap Generator Plugin

A lot of the new WordPress sites I’m working on have custom post types. A lot of plugins that I use haven’t caught up with the new functionality yet, and the Google Sitemap Generator is no exception. I found a patch here that uses an existing hook in the plugin and seems to work great [...]

Read full story Comments { 0 }