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 the following syntax: For example, […]

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: Now any other site that tries to load your WP blog in a frame will get this instead: (The actual error message will vary depending on the browser. […]

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: The resulting menu will look like this:

Continue Reading...

Security Tip: Block Direct Access To Plugin PHP Files

April 27th, 2012

Plugins are usually loaded and executed along with the rest of WordPress. However, since each plugin is physically just set of .php, .css and .js files, it is also possible for someone to bypass the normal load order and execute the plugin files directly. Ā They just need to type the right URL in the address […]

Continue Reading...

Cleaning Up Stale Transients

April 17th, 2012

WordPress transients are very similar to DB options but they also support expiration times. The Transients API documentation states: Our transient will die naturally of old age once $expiration seconds have passed since we last ran set_transient() What you might not know if you haven’t explored the source code of the transients API is that […]

Continue Reading...