Adding custom columns to the WordPress comments admin page

Adding custom columns to the WordPress admin pages is fairly easy, however not all the filters available to you are displayed on Plugin API Filter Reference page. The following article will take you through the process of adding additional columns to the comments admin page using two undocumented filters.

If you are not a plugin author intending to use this functionality within a plugin, you should place the following code examples into your theme’s functions.php file.

Continue reading “Adding custom columns to the WordPress comments admin page”

Connecting to an Apple Time Capsule Disk over the internet (WAN) using Windows

If you are like myself and sitting on the fence between Windows and Apple based products, you may want to communicate between Windows1 and your Apple Time Capsule Disk both locally (LAN) and via the internet (WAN).

Setting up the Time Capsule Disk as just a local network drive is fairly easy2, however there is little instruction on sharing disks over WAN if you’re using Windows.

Continue reading “Connecting to an Apple Time Capsule Disk over the internet (WAN) using Windows”

WordPress append page slug to body class

Styling different pages in WordPress is a relatively easy process if you make use of the default body classes that are made available to you, especially the unique page ID class “page-id-123“.

The problem with using the ID class to identify an individual page is that a page ID can quite easily change when working with a development version or even migrating your blog from one install to another. Continue reading “WordPress append page slug to body class”

How to remove the Admin Bar in WordPress 3.1 correctly

Although the WordPress Admin Bar can be hidden by a user visiting their profile page in the Admin Panel (Users > Your Profile), there may be a situation where you want to force the removal without instructing the user to amend their settings or updating their settings automatically.

When the issue of removing the Admin Bar first cropped up, the solution was to remove the associated init action, however this is not the correct method of disabling it and should not be used. Continue reading “How to remove the Admin Bar in WordPress 3.1 correctly”

Fixing the incorrect auto date and time on the iPhone 4

If you are having problems with your iPhone 4 displaying the incorrect date and time when using the “Set Automatic” option, there are a number of possible solutions that could fix the problem.

The issue in my case seemed to be caused by the the phone shutting down automatically due to an empty battery, although there may be other causes. Continue reading “Fixing the incorrect auto date and time on the iPhone 4”

WordPress append image dimensions as class names

When inserting images into post or page content WordPress automatically adds three class name to the image tag along with the other attributes, these are the alignment (alignnone), size (size-full) and the attachment id (wp-image-123).

If you need to add additional class names to the defaults without having to manually add them every time you insert a new image, you can make use of either the get_image_tag_class or get_image_tag filters. Continue reading “WordPress append image dimensions as class names”

WordPress: Prevent auto tags in page content

If you make use of some basic mark-up in your WordPress page content, you may have encountered an issue where <br /> tags are appearing where they shouldn’t and are affecting your theme layout.

To prevent this happening but leave the auto conversion of double line-breaks into paragraph tags, I had a dig into the wpautop function that runs before the content is outputted to the screen. Continue reading “WordPress: Prevent auto tags in page content”

Outputting JSON with Zend Framework

Today I was looking for a quick solution to outputting a response in JSON format from within one of my existing Zend_Controller actions that could be both requested and parsed using one of the jQuery Ajax methods.

The easiest method I could find was to use something similar to the following which first detects whether or not an XHTTP request has taken place, then outputs the response in plain text format. Continue reading “Outputting JSON with Zend Framework”