How To Create A Table Of Contents Shortcode

June 19th, 2012

It’s time for another WordPress plugin development tutorial 🙂 In this post, I will provide a step-by-step explanation of how to create a WordPress plugin that lets the user add an automatically generated table of contents (TOC) to their posts by using a simple shortcode.

The completed plugin will support […] Continue Reading…


How To Easily Stop Your Site From Being Loaded In A Frame

June 7th, 2012

As of WordPress 3.1.3, it’s really easy to prevent unscrupulous web developers from displaying your site in a frame. Just add this one-liner to your functions.php file:

add_action('init', 'send_frame_options_header', 10, 0);

Now any other site that tries to load your WP blog in a frame will get this instead:

(The actual […] Continue Reading…


Redis Object Cache Plugin

May 24th, 2012

Redis Object Cache is a WordPress plugin that provides a persistent, Redis-based backend for the WordPress object cache. Use it if you want to speed up your site and prefer Redis to other key-value stores.

Fair warning: If you’re not sure what Redis is and are just looking for ways to […] Continue Reading…


Celtic Knot Generator – A HTML5 Canvas Experiment

May 17th, 2012

I wanted to familiarize myself with the much-touted canvas element, so I used it to build an interactive celtic knot generator/editor. Give it a try.

Launch the celtic knot generator.

Note: Requires a fairly modern browser.
Instructions
When you first load up the knot generator, you will see a 10×10 grid filled with […] Continue Reading…


Adding A Notification Bubble To An Admin Menu Item

May 3rd, 2012

You’ve probably seen the small notification bubble that shows up in the Dashboard menu when a new update is available. Here’s how you can add a menu bubble to your own custom menu:

function add_menu_with_notification_bubble() {
	$bubble = sprintf(
		' <span class="update-plugins"><span class="update-count">%d</span></span>',
		42 //bubble contents
	);
	add_dashboard_page(
		'Example Menu',
		'Example Menu' . $bubble,
		'read',
		'example-menu-item'
	);
}
add_action('admin_menu', 'add_menu_with_notification_bubble');

The resulting […] Continue Reading…